Class ItemService

Description

Holds methods for receiving Items of the initialized Itemtype.

  • version: $Id: ItemService.php,v 1.22 2006/12/29 18:22:54 kpapst Exp $
  • copyright: Copyright (C) 2002-2006 Kevin Papst
  • author: Kevin Papst
  • license: GNU Public License
MasterItemType
   |
   --Itemtype
      |
      --ItemService
Direct descendents
Class Description
FileService The FileService serves all kinds of File Items.
ImageService The ImageService serves Image Items.
ItemAdminService The ItemAdminService provides all kind of methods for write access to any Item and Item Language Version of all Itemtypes.
MenuService Class used for handling Menus.
Method Summary
ItemService ItemService ([ $itemtype = ''])
int countAllItems ()
void countLevel ( $item_id)
void getItem ( $item_id, [ $treetype = ITEM_LOAD_FULL], [ $languageID = ''])
void getItemLanguageEnumeration ( $item_id)
void getItemtype ()
void getLastEditedItems (String $language_id, [ $start = '0'], [ $stop = '5'])
void getLightTree ( $id, [ $orderby = ORDER_COLUMN_POSITION])
void getLightTreeForLanguage ( $id,  $languageID, [ $orderby = ORDER_COLUMN_POSITION])
void getTree ( $id, [ $orderby = ORDER_COLUMN_POSITION])
void getTreeForLanguage ( $id,  $languageID, [ $orderby = ORDER_COLUMN_POSITION])
void getTreeWalker ( $id, [ $orderby = ORDER_COLUMN_POSITION])
array getWayHome (int $item_id, boolean $include)
void initItemService ( $itemtype)
boolean isChildOf ( $parent_id,  $child_id)
boolean isLeaf ( $itemID)
Methods
Constructor ItemService (line 45)

Initalizes a new ItemService for the given Itemtype.

ItemService ItemService ([ $itemtype = ''])
  • $itemtype
countAllItems (line 149)

Counts all Items, except TOP_LEVEL.

This does only count one version of each item. If a Item has several language Versions, only one of them is counted.

  • return: the amount of all Items
int countAllItems ()
countLevel (line 89)

Calculates the Level beneath TOP LEVEL.

void countLevel ( $item_id)
  • $item_id
getItem (line 57)
void getItem ( $item_id, [ $treetype = ITEM_LOAD_FULL], [ $languageID = ''])
  • $item_id
  • $treetype
  • $languageID
getItemLanguageEnumeration (line 81)
void getItemLanguageEnumeration ( $item_id)
  • $item_id
getItemtype (line 53)
void getItemtype ()
getLastEditedItems (line 125)

Get the last edited Items for the specified Language.

You may define the amount of items by setting the Start and Stop values.

void getLastEditedItems (String $language_id, [ $start = '0'], [ $stop = '5'])
  • String $language_id: language_id the Language ID
  • $start
  • $stop
getLightTree (line 69)
void getLightTree ( $id, [ $orderby = ORDER_COLUMN_POSITION])
  • $id
  • $orderby
getLightTreeForLanguage (line 77)
void getLightTreeForLanguage ( $id,  $languageID, [ $orderby = ORDER_COLUMN_POSITION])
  • $id
  • $languageID
  • $orderby
getTree (line 65)
void getTree ( $id, [ $orderby = ORDER_COLUMN_POSITION])
  • $id
  • $orderby
getTreeForLanguage (line 73)
void getTreeForLanguage ( $id,  $languageID, [ $orderby = ORDER_COLUMN_POSITION])
  • $id
  • $languageID
  • $orderby
getTreeWalker (line 61)
void getTreeWalker ( $id, [ $orderby = ORDER_COLUMN_POSITION])
  • $id
  • $orderby
getWayHome (line 99)
  • return: an Array with Item ID for the Way Home
array getWayHome (int $item_id, boolean $include)
  • int $item_id: the Item ID to start from
  • boolean $include: whether to include the Start ID or not
initItemService (line 49)
void initItemService ( $itemtype)
  • $itemtype
isChildOf (line 196)

Returns true if "child" is somewhere beneath "parent" in the Menu Tree.

This method is time consuming!

  • return: whether child_id is a child of parent_id
boolean isChildOf ( $parent_id,  $child_id)
  • $parent_id
  • $child_id
isLeaf (line 173)

Checks whether the given Item is a Leaf.

The check will be performed above all languages, so if the Item exists ONLY in German, but the Childs are all in English, it returns FALSE, even if you do not see children within a Navigation (for example).

  • return: TRUE if the Item has childs in any language, FALSE otherwise
boolean isLeaf ( $itemID)
  • $itemID

Inherited Methods

Inherited From Itemtype

Itemtype::Itemtype()
Itemtype::getClass()
Itemtype::getClassName()
Itemtype::getCommand()
Itemtype::getDirectory()
Itemtype::getItemtypeID()
Itemtype::initItemtype()

Inherited From MasterItemType

MasterItemType::MasterItemType()
MasterItemType::countItemtypes()
MasterItemType::getClassForItemType()
MasterItemType::getClassNameForItemType()
MasterItemType::getCommandForItemType()
MasterItemType::getDirectoryForItemType()
MasterItemType::getItemTypeForCommand()
MasterItemType::getSelectColumns()

Documentation generated by phpDocumentor 1.3.1