ZenMagick 0.9.1


org.zenmagick.model.catalog.ZMCategory

Class ZMCategory

ZMObject
|
+--ZMModel
|
+--ZMCategory

public class ZMCategory
extends ZMModel

A single category

Author:
mano
Version:
$Id: ZMCategory.php 999 2008-04-07 04:14:17Z DerManoMann $

Constructor Summary

ZMCategory()

Create new instance.

Method Summary
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.

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.ZMModel
get, populate, set
Methods inherited from org.zenmagick.ZMObject
backtrace, create, log, singleton

Constructor Detail

ZMCategory

public ZMCategory()

Create new instance. /


Method Detail

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.

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.1