ZenMagick 0.9.10


zenmagick.store.shared.services.catalog\ZMCategories
services\catalog\ZMCategories.php at line 36

Class ZMCategories

ZMObject
└─ZMCategories

public class ZMCategories
extends ZMObject

Category DAO.

The cache implementation used can be configured via the setting 'apps.store.categories.cache'. Default is ZMCache::TRANSIENT.

Author:
DerManoMann

Fields inherited from org.zenmagick.core\ZMObject
properties_
Method Summary
void

__construct()

Create new instance.

Category

createCategory(ZMCategory category)

Create a new category.

array

getAllCategories(int languageId)

Get all categories.

array

getCategories(int languageId, array ids)

Get all categories.

ZMCategory

getCategoryForId(int categoryId, int languageId)

Get a category for the given id.

array

getCategoryTree(int languageId)

This returns, in fact, not a real tree, but a list of all top level categories.

ZMCategory

getDefaultCategoryForProductId(int productId, int languageId)

Get the default category for the given product id.

ZMMetaTagDetails

getMetaTagDetailsForId(int categoryId, int languageId)

Get meta tag details for the given id and language.

array

getProductTypeIds(mixed categoryId)

Get the allowed product types (ids) for the given category id.

array

getRootCategories(int languageId)

Get all root categories.

static void

instance()

Get instance.

protected void

invalidateCache(int languageId)

Invalidate all cache entries.

protected array

loadAndInitTree(int languageId)

Load all categories and init the category tree.

Category

updateCategory(ZMCategory category)

Update an existing category.

Methods inherited from org.zenmagick.core\ZMObject
__construct, attachMethod, get, getAttachedMethods, getProperties, getPropertyNames, set, singleton

Method Detail

services\catalog\ZMCategories.php at line 52

__construct

public void __construct()

Create new instance.


services\catalog\ZMCategories.php at line 237

createCategory

public Category createCategory(ZMCategory category)

Create a new category.

Parameters:
category - The category.
Returns:
The updated category.

services\catalog\ZMCategories.php at line 139

getAllCategories

public array getAllCategories(int languageId)

Get all categories.

Parameters:
languageId - Language id.
Returns:
A list of ZMCategory instances.

services\catalog\ZMCategories.php at line 150

getCategories

public array getCategories(int languageId, array ids)

Get all categories.

Parameters:
languageId - Language id.
ids - Optional list of category ids; default is null.
Returns:
A list of ZMCategory instances.

services\catalog\ZMCategories.php at line 198

getCategoryForId

public ZMCategory getCategoryForId(int categoryId, int languageId)

Get a category for the given id.

Parameters:
categoryId - The category id.
languageId - Language id.
Returns:
A ZMCategory instance or null.

services\catalog\ZMCategories.php at line 178

getCategoryTree

public array getCategoryTree(int languageId)

This returns, in fact, not a real tree, but a list of all top level categories.

Parameters:
languageId - Language id.
Returns:
A list of all top level categories (parentId == 0).

services\catalog\ZMCategories.php at line 83

getDefaultCategoryForProductId

public ZMCategory getDefaultCategoryForProductId(int productId, int languageId)

Get the default category for the given product id.

This will return the first mapped category.

Parameters:
productId - The product id.
languageId - Language id.
Returns:
The default category (or null).

services\catalog\ZMCategories.php at line 315

getMetaTagDetailsForId

public ZMMetaTagDetails getMetaTagDetailsForId(int categoryId, int languageId)

Get meta tag details for the given id and language.

Parameters:
categoryId - The category id.
languageId - Language id.
Returns:
The details or null.

services\catalog\ZMCategories.php at line 249

getProductTypeIds

public array getProductTypeIds(mixed categoryId)

Get the allowed product types (ids) for the given category id.

Returns:
List of allowed product type ids; an empty list means no restrictions.

services\catalog\ZMCategories.php at line 103

getRootCategories

public array getRootCategories(int languageId)

Get all root categories.

Parameters:
languageId - Language id.
Returns:
A list of ZMCategory instances.

services\catalog\ZMCategories.php at line 70

instance

public static void instance()

Get instance.


services\catalog\ZMCategories.php at line 213

invalidateCache

protected void invalidateCache(int languageId)

Invalidate all cache entries.

Parameters:
languageId - The language id.

services\catalog\ZMCategories.php at line 283

loadAndInitTree

protected array loadAndInitTree(int languageId)

Load all categories and init the category tree.

Parameters:
languageId - Language id.
Returns:
List of all loaded and initialized categories.

services\catalog\ZMCategories.php at line 225

updateCategory

public Category updateCategory(ZMCategory category)

Update an existing category.

Parameters:
category - The category.
Returns:
The updated category.

ZenMagick 0.9.10