Class: CategoryService

Source Location: /CORE/system/classes/category/CategoryService.php

Class CategoryService

Class Overview

The CategoryService serves all kinds of Category Objects.

Located in /CORE/system/classes/category/CategoryService.php [line 40]



		
				Author(s):
		
  • Kevin Papst
Information Tags:
Version:  $Id: CategoryService.php,v 1.9 2007/01/08 21:47:19 kpapst Exp $
Copyright:  Copyright (C) 2002-2006 Kevin Papst
License:  GNU Public License

Methods

[ Top ]
Method Summary
CategoryService   CategoryService()   Instantiates a new CategoryService.
int   countLinksForCategory()   Count the lins for a Category
array   getAllItemsForCategory()   THE IMPLEMENTATION MAY CHANGE, BE CAREFUL WHEN USING! Fetches all Items that are linked to a Category, Itemtype independ.
Category   getCategory()   Fetch the Category Object with the given ID.
CategoryTreeWalker   getCategoryEnumeration()   Returns a new CategoryTreeWalker to get information about Categorys, in their tree-order
ItemCategoryEnumeration   getCategorysForItem()   Get a list of all Categorys that are linked to the given Item.
CategoryItemEnumeration   getItemsForCategory()   Returns an Enumeration above all Items (for the given Itemtype), that are linked to a Category.
Category   getTopLevel()   Gets the Category Top Level Item.
boolean   isItemLinkedToCategory()   Returns whether an Item id lnked to a known Category.

[ Top ]
Methods
Constructor CategoryService  [line 47]

  CategoryService CategoryService( )

Instantiates a new CategoryService.

This is used for receiving any kind of Category Object.



[ Top ]
countLinksForCategory  [line 122]

  int countLinksForCategory( $categoryid  )

Count the lins for a Category

Parameters:
   $categoryid: 

API Tags:
Return:  the amount of linked items for the Category


[ Top ]
getAllItemsForCategory  [line 109]

  array getAllItemsForCategory( $categoryid  )

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

Parameters:
   $categoryid: 

API Tags:
Return:  see list above for array indices


[ Top ]
getCategory  [line 64]

  Category getCategory( int $id  )

Fetch the Category Object with the given ID.

Parameters:
int   $id:  id the Category ID

API Tags:
Return:  the Category


[ Top ]
getCategoryEnumeration  [line 73]

  CategoryTreeWalker getCategoryEnumeration( )

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


API Tags:
Return:  the CategoryTreeWalker


[ Top ]
getCategorysForItem  [line 92]

  ItemCategoryEnumeration getCategorysForItem( $itemtype_id, $item_id  )

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

Parameters:
   $itemtype_id: 
   $item_id: 

API Tags:
Return:  list of Categorys


[ Top ]
getItemsForCategory  [line 83]

  CategoryItemEnumeration getItemsForCategory( $itemtype_id, $categoryid  )

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

Parameters:
   $itemtype_id: 
   $categoryid: 

API Tags:
Return:  list of Items


[ Top ]
getTopLevel  [line 54]

  Category getTopLevel( )

Gets the Category Top Level Item.


API Tags:
Return:  the Top Level Category


[ Top ]
isItemLinkedToCategory  [line 132]

  boolean isItemLinkedToCategory( $itemtype_id, $item_id, $category_id  )

Returns whether an Item id lnked to a known Category.

Parameters:
   $itemtype_id: 
   $item_id: 
   $category_id: 

API Tags:
Return:  if the item is linked or not


[ Top ]