getCategory

getCategory ( string search , boolean _usePath , boolean _isCloserSearch , boolean _returnList ) : int_or_array

Returns the corresponding category ID in all registred 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

updateCategories
activeFlexibleComparaison

Parameters

search

what you search in the list.

_usePath (optional)

• if false (default), category name is used
• if true, category path is used (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.

_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.