Class CategoryService

Description

The CategoryService serves all kinds of Category Objects.

  • version: $Id: CategoryService.php,v 1.9 2007/01/08 21:47:19 kpapst Exp $
  • copyright: Copyright (C) 2002-2006 Kevin Papst
  • author: Kevin Papst
  • license: GNU Public License


			
Method Summary
CategoryService CategoryService ()
int countLinksForCategory ( $categoryid)
array getAllItemsForCategory ( $categoryid)
Category getCategory (int $id)
ItemCategoryEnumeration getCategorysForItem ( $itemtype_id,  $item_id)
CategoryItemEnumeration getItemsForCategory ( $itemtype_id,  $categoryid)
boolean isItemLinkedToCategory ( $itemtype_id,  $item_id,  $category_id)
Methods
Constructor CategoryService (line 47)

Instantiates a new CategoryService.

This is used for receiving any kind of Category Object.

CategoryService CategoryService ()
countLinksForCategory (line 122)

Count the lins for a Category

  • return: the amount of linked items for the Category
int countLinksForCategory ( $categoryid)
  • $categoryid
getAllItemsForCategory (line 109)

THE IMPLEMENTATION MAY CHANGE, BE CAREFUL WHEN USING! Fetches all Items that are linked to a Category, Itemtype independ.

Returns an Result array.

The Array has the usable Indices:

  • itemid
  • itemtype

  • return: see list above for array indices
array getAllItemsForCategory ( $categoryid)
  • $categoryid
getCategory (line 64)

Fetch the Category Object with the given ID.

  • return: the Category
Category getCategory (int $id)
  • int $id: id the Category ID
getCategoryEnumeration (line 73)

Returns a new CategoryTreeWalker to get information about Categorys, in their tree-order

  • return: the CategoryTreeWalker
CategoryTreeWalker getCategoryEnumeration ()
getCategorysForItem (line 92)

Get a list of all Categorys that are linked to the given Item.

  • return: list of Categorys
ItemCategoryEnumeration getCategorysForItem ( $itemtype_id,  $item_id)
  • $itemtype_id
  • $item_id
getItemsForCategory (line 83)

Returns an Enumeration above all Items (for the given Itemtype), that are linked to a Category.

  • return: list of Items
CategoryItemEnumeration getItemsForCategory ( $itemtype_id,  $categoryid)
  • $itemtype_id
  • $categoryid
getTopLevel (line 54)

Gets the Category Top Level Item.

  • return: the Top Level Category
Category getTopLevel ()
isItemLinkedToCategory (line 132)

Returns whether an Item id lnked to a known Category.

  • return: if the item is linked or not
boolean isItemLinkedToCategory ( $itemtype_id,  $item_id,  $category_id)
  • $itemtype_id
  • $item_id
  • $category_id

Documentation generated by phpDocumentor 1.3.1