Class SGL_Category

Description

Wrapper to SGL_NestedSet, to manipulate Categories.

Located in /SGL/Category.php (line 54)


	
			
Direct descendents
Class Description
 class SGL_CategoryPerms Basic Permission object.
Variable Summary
 mixed $_da
 mixed $_params
Method Summary
 void SGL_Category ()
 array create ( &$values, array $values)
 void debug ([ $id = 0])
 void delete ( &$aDelete, array $aDelete)
 string getBreadCrumbs (integer $category_id, [boolean $links = true], [string $style = ''], [ $lastLink = false])
 array getChildren (int $id)
 string getLabel (int $id)
 array getPerms ()
 array getTree ()
 array getValues ()
 bool hasPerms ()
 boolean isBranch (int $id)
 bool load (int $category_id)
 void move (int $category_id, int $target_id, int $pos)
 void render ()
 string update (int $category_id,  &$values, array $values)
Variables
mixed $_da = null (line 58)
mixed $_nestedSetNode = array() (line 57)
mixed $_params = array() (line 56)
Methods
Constructor SGL_Category (line 65)

Constructor.

void SGL_Category ()
create (line 100)

Create a Category with given values.

  • return: NestedSet node created
  • access: public
array create ( &$values, array $values)
  • array $values: Category values
  • &$values
debug (line 508)
void debug ([ $id = 0])
  • $id
delete (line 205)

Delete several Categories.

  • access: public
void delete ( &$aDelete, array $aDelete)
  • array $aDelete: Array of Category IDs to delete
  • &$aDelete
getBreadCrumbs (line 439)

Generates breadcrumbs for category

  • access: public
string getBreadCrumbs (integer $category_id, [boolean $links = true], [string $style = ''], [ $lastLink = false])
  • integer $category_id
  • boolean $links: add link to the current CatID
  • string $style: CSS Class
  • $lastLink
getChildren (line 386)

Retrieve children

  • return: categories children
  • access: public
array getChildren (int $id)
  • int $id
getLabel (line 497)

Retrieves category label

  • access: public
string getLabel (int $id)
  • int $id
getPerms (line 307)

Get current Category permissions.

Category must be loaded before using this function.

  • return: Current Category permissions
  • access: public
array getPerms ()
getTree (line 367)

Get a tree representing all Categories.

  • return: Categories tree
  • access: public
array getTree ()
getValues (line 286)

Get current Category values.

Category must be loaded before using this function.

  • return: NestedSet node representing the current Category
  • access: public
array getValues ()
hasPerms (line 344)

Returns true if current user has perms to view a category.

Category must be loaded before using this function.

  • access: public
bool hasPerms ()
isBranch (line 416)

Checks if an category is a branch

  • access: public
boolean isBranch (int $id)
  • int $id
load (line 257)

Load a Category, given its ID.

  • return: TRUE if loaded, FALSE if error
  • access: public
bool load (int $category_id)
  • int $category_id: Category ID to load
move (line 237)

Move a Category.

  • access: public
void move (int $category_id, int $target_id, int $pos)
  • int $category_id: Category ID to move
  • int $target_id: New parent
  • int $pos: New position
render (line 526)
void render ()
update (line 139)

Update a Category with given values.

  • return: An empty string if error while updating, else a message to display.
  • access: public
string update (int $category_id,  &$values, array $values)
  • int $category_id: Category ID to update
  • array $values: Values to set
  • &$values

Redefined in descendants as:

Documentation generated on Tue, 23 Feb 2010 18:14:28 +0000 by phpDocumentor 1.4.3