ZMObject
|
+--ZMCategories
public class ZMCategories
extends ZMObject
| Field Summary | |
|---|---|
| protected mixed | Flat list of ZMCategory instances. |
| Fields inherited from org.zenmagick.ZMObject | |
|---|---|
| properties_ | |
| Constructor Summary | |
|---|---|
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. |
| 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.ZMObject | |
|---|---|
| attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton | |
protected mixed $categories_
Flat list of ZMCategory instances.
This gets loaded on demand, so subclasses have to ensure this is populated before using it.
/public ZMCategories()
Create new instance. /
protected void buildTree(int languageId)
Create tree data.
null.public Category createCategory(ZMCategory category)
Create a new category.
public array getCategories(array ids, int languageId)
Get all categories.
null.ZMCategory instances.public ZMCategory getCategoryForId(int categoryId, int languageId)
Get a category for the given id.
null.ZMCategory instance or null.public array getCategoryTree(int languageId)
This returns, in fact, not a real tree, but a list of all top level categories.
null.parentId == 0).public ZMCategory getDefaultCategoryForProductId(int productId, int languageId)
Get the default category for the given product id.
This will return the first mapped category.
null.null).public array getProductTypeIds(mixed categoryId)
Get the allowed product types (ids) for the given category id.
public static void instance()
Get instance. /
protected void load(int languageId)
Load all categories.
null.public Category updateCategory(ZMCategory category)
Update an existing category.
Category DAO.