ZenMagick 0.9.6


org.zenmagick.model.catalog.ZMCategory

Class ZMCategory

ZMObject
|
+--ZMCategory

public class ZMCategory
extends ZMObject

A single category

Author:
DerManoMann
Version:
$Id: ZMCategory.php 2054 2009-03-12 03:41:22Z dermanomann $

Fields inherited from org.zenmagick.ZMObject
properties_
Constructor Summary

ZMCategory()

Create new instance.

Method Summary
void

addChild(mixed child)

Add a child category.

array

getChildIds(boolean includeSelf)

Get a list of all child category ids.

array

getChildren()

Get the child categories of this category.

string

getDescription()

Get the category description.

int

getId()

Get the id.

string

getImage()

Get the category image (if any).

ZMImageInfo

getImageInfo()

Get the categories image ino instance (if any).

int

getLanguageId()

Get the language id.

string

getName()

Get the category name.

ZMCategory

getParent()

Get the parent category (if any).

int

getParentId()

Get the parent category id (if any).

string

getPath()

Get the category path.

array

getPathArray()

Get the category path array.

array

getProductTypeIds()

Get a list of allowed product types.

int

getSortOrder()

Get the sort order.

boolean

hasChildren()

Checks if this category has children.

boolean

hasParent()

Checks if the catgory has a parent.

boolean

isActive()

Checks if this category is active; ie.

void

setActive(boolean active)

Set the active flag.

void

setDescription(string description)

Set the category description.

void

setId(int id)

Set the id.

void

setImage(string image)

Set the category image (if any).

void

setLanguageId(int languageId)

Set the language id.

void

setName(string name)

Set the category name.

void

setParentId(int parentId)

Set the parent category id.

void

setSortOrder(int sortOrder)

Set the sort order.

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

Constructor Detail

ZMCategory

public ZMCategory()

Create new instance. /


Method Detail

addChild

public void addChild(mixed child)

Add a child category.

Parameters:
child - Either a category or category id.

getChildIds

public array getChildIds(boolean includeSelf)

Get a list of all child category ids.

Parameters:
includeSelf - Optional flag to include this category in the list; default is true.
Returns:
A list of category ids.

getChildren

public array getChildren()

Get the child categories of this category.

Returns:
A list of ZMcategory instances.

getDescription

public string getDescription()

Get the category description.

Returns:
The description.

getId

public int getId()

Get the id.

Returns:
The category id.

getImage

public string getImage()

Get the category image (if any).

Returns:
The image name.

getImageInfo

public ZMImageInfo getImageInfo()

Get the categories image ino instance (if any).

Returns:
The ZMImageInfo for this categorie's image, or null.

getLanguageId

public int getLanguageId()

Get the language id.

Returns:
The language id.

getName

public string getName()

Get the category name.

Returns:
The category name.

getParent

public ZMCategory getParent()

Get the parent category (if any).

Returns:
The parent category or null.

getParentId

public int getParentId()

Get the parent category id (if any).

Returns:
The parent category id or 0.

getPath

public string getPath()

Get the category path.

This method will return a value that can be used as cPath value in a URL pointing to this category.

Returns:
The category path in the form cPath=[PATH].

getPathArray

public array getPathArray()

Get the category path array.

Returns:
The category path as array of categories with the last element being the products category.

getProductTypeIds

public array getProductTypeIds()

Get a list of allowed product types.

An empty list means no restrictions.

Returns:
List of allowed product type ids (might be empty).

getSortOrder

public int getSortOrder()

Get the sort order.

Returns:
The sort order.

hasChildren

public boolean hasChildren()

Checks if this category has children.

Returns:
true if this category has children, false if not.

hasParent

public boolean hasParent()

Checks if the catgory has a parent.

Returns:
true if this category has a parent, false if not.

isActive

public boolean isActive()

Checks if this category is active; ie. visible in the storefront.

Returns:
true if this category is active, false if not.

setActive

public void setActive(boolean active)

Set the active flag.

Parameters:
active - true if this category is active, false if not.

setDescription

public void setDescription(string description)

Set the category description.

Parameters:
description - The description.

setId

public void setId(int id)

Set the id.

Parameters:
id - The category id.

setImage

public void setImage(string image)

Set the category image (if any).

Parameters:
image - The image name.

setLanguageId

public void setLanguageId(int languageId)

Set the language id.

Parameters:
languageId - The language id.

setName

public void setName(string name)

Set the category name.

Parameters:
name - The category name.

setParentId

public void setParentId(int parentId)

Set the parent category id.

Parameters:
parentId - The parent category id.

setSortOrder

public void setSortOrder(int sortOrder)

Set the sort order.

Parameters:
sortOrder - The sort order.

ZenMagick 0.9.6