ZenMagick 0.9.8


org.zenmagick.store.services.catalog.ZMCategories
\store\services\catalog\ZMCategories.php at line 34

Class ZMCategories

ZMObject
└─ZMCategories

public class ZMCategories
extends ZMObject

Category DAO.

Author:
DerManoMann
Version:
$Id: ZMCategories.php 2694 2009-12-03 22:32:18Z dermanomann $

Field Summary
protected mixed

$categories_

Flat list of ZMCategory instances.

Fields inherited from org.zenmagick.core.ZMObject
properties_
Constructor Summary

ZMCategories()

Create new instance.

Method Summary
protected void

buildTree(int languageId)

Create tree data.

Category

createCategory(ZMCategory category)

Create a new category.

array

getCategories(array ids, int languageId)

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.

static void

instance()

Get instance.

protected void

load(int languageId)

Load all categories.

Category

updateCategory(ZMCategory category)

Update an existing category.

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

Field Detail

\store\services\catalog\ZMCategories.php at line 41

categories_

protected mixed $categories_

Flat list of ZMCategory instances.

This gets loaded on demand, so subclasses have to ensure this is populated before using it.


Constructor Detail

\store\services\catalog\ZMCategories.php at line 50

ZMCategories

public ZMCategories()

Create new instance.


Method Detail

\store\services\catalog\ZMCategories.php at line 252

buildTree

protected void buildTree(int languageId)

Create tree data.

Parameters:
languageId - Optional language id; default is null.

\store\services\catalog\ZMCategories.php at line 193

createCategory

public Category createCategory(ZMCategory category)

Create a new category.

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

\store\services\catalog\ZMCategories.php at line 106

getCategories

public array getCategories(array ids, int languageId)

Get all categories.

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

\store\services\catalog\ZMCategories.php at line 160

getCategoryForId

public ZMCategory getCategoryForId(int categoryId, int languageId)

Get a category for the given id.

Parameters:
categoryId - The category id.
languageId - Optional language id; default is null.
Returns:
A ZMCategory instance or null.

\store\services\catalog\ZMCategories.php at line 133

getCategoryTree

public array getCategoryTree(int languageId)

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

Parameters:
languageId - Optional language id; default is null.
Returns:
A list of all top level categories (parentId == 0).

\store\services\catalog\ZMCategories.php at line 79

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 - Optional language id; default is null.
Returns:
The default category (or null).

\store\services\catalog\ZMCategories.php at line 272

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.

\store\services\catalog\ZMCategories.php at line 204

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.

\store\services\catalog\ZMCategories.php at line 66

instance

public static void instance()

Get instance.


\store\services\catalog\ZMCategories.php at line 225

load

protected void load(int languageId)

Load all categories.

Parameters:
languageId - Optional language id; default is null.

\store\services\catalog\ZMCategories.php at line 182

updateCategory

public Category updateCategory(ZMCategory category)

Update an existing category.

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

ZenMagick 0.9.8