getCategoryIn ( string search , string idParentCategory , boolean _returnPath , boolean _isCloserSearch , boolean _returnList ) : int_or_array
Returns the corresponding category ID in sub-categories of a parent category (in the cache list). You must refresh this cache everytime you add an new element on your site. Else the list will be obsolete.
Use activeFlexibleComparaison to ignore for example accent differences in the search.
See also
updateCategoriesactiveFlexibleComparaison
Parameters
search
what you search in the list.
idParentCategory
category ID where search must be found.
_returnPath (optional)
• if false (default), returns the category name
• if true, returns the category path with parent categories.
• if true, returns the category path with parent categories.
_isCloserSearch (optional)
• if false (default), the function return the corresponding ID if there is an exact matching and null else
• if true, it returns everytime someting. In IA algorithm compare textual similarities and return the closer element ID.
• if true, it returns everytime someting. In IA algorithm compare textual similarities and return the closer element ID.
_returnList (optional)
• if false (default), it return an ID
• if true, it returns a list of ID. So if isCloserSearch=false, it returns all element with a name equals to the search. If isCloserSearch=true, it returns all the list ordered by proximity.
• if true, it returns a list of ID. So if isCloserSearch=false, it returns all element with a name equals to the search. If isCloserSearch=true, it returns all the list ordered by proximity.