CategoryService
Namespace
IO\Services
Type | Name | Description |
---|---|---|
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Methods
public __construct($category)
CategoryService constructor.
Type |
Name |
Description |
|
public setCurrentCategoryID($catID)
Set the current category by ID.
Type |
Name |
Description |
|
The id of the current category |
public setCurrentCategory($cat)
Set the current category by ID.
Type |
Name |
Description |
|
The current category |
public getCurrentCategory():Category
public get($catID, $lang = null):Category
Get a category by ID
Type |
Name |
Description |
|
The category ID |
|
|
The language to get the category |
public getForPlentyId()
public getCurrentCategoryChildren()
public getURL($category, $lang = null, $):string
Return the URL for a given category ID.
Type |
Name |
Description |
|
the category to get the URL for |
|
|
the language to get the URL for |
|
|
public getURLById()
public isCurrent($category):bool
Check whether a category is referenced by the current route
Type |
Name |
Description |
|
The category to check |
public isOpen($category):bool
Check whether any child of a category is referenced by the current route
Type |
Name |
Description |
|
The category to check |
public isActive($category = null):bool
Check whether a category or any of its children is referenced by the current route
Type |
Name |
Description |
|
The category to check |
public getItems($category = null, $params = [], $page = 1): PaginatedResult
Type |
Name |
Description |
|
||
|
||
|
Return the sitemap tree as an array
Type |
Name |
Description |
|
Only return categories of given types |
|
|
The language to get sitemap tree for |
|
|
The deepest category level to load |
|
|
The customer class id to get tree |
public getPartialTree()
Return the sitemap list as an array
Type |
Name |
Description |
|
Only return categories of given type |
|
|
The language to get sitemap list for |
public getHierarchy($catID, $bottomUp = false, $filterCategories = false):array
Returns a list of all parent categories including given category
Type |
Name |
Description |
|
The category Id to get the parents for or 0 to use current category |
|
|
Set true to order result from bottom (deepest category) to top (= level 1) |
|
|
Filter categories |
public isVisibleForWebstore()
public setCurrentItem($item)
Type |
Name |
Description |
|
public getCurrentItem()
Type |
Name |
Description |
|
public fromMemoryCache()
public resetMemoryCache($key = null)
Type |
Name |
Description |
|