Class: ItemService

Source Location: /CORE/system/classes/item/ItemService.php

Class ItemService

Class Overview

Holds methods for receiving Items of the initialized Itemtype.

Located in /CORE/system/classes/item/ItemService.php [line 40]

MasterItemType
   |
   --Itemtype
      |
      --ItemService
Author(s):
  • Kevin Papst
Information Tags:
Version:  $Id: ItemService.php,v 1.24 2008/10/10 14:37:34 kpapst Exp $
Copyright:  Copyright (C) Kevin Papst
License:  GNU Public License

Methods

[ Top ]
Descendants
Child Class Description
FileService The FileService serves all kinds of File Items.
ItemAdminService The ItemAdminService provides all kind of methods for write access to any Item and Item Language Version of all Itemtypes.
ImageService The ImageService serves Image Items.
MenuService Class used for handling Menus.

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From Itemtype

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

Inherited From MasterItemType

MasterItemType::MasterItemType()
Empty Constructor.
MasterItemType::countItemtypes()
Returns how many Itemtypes are known by the System.
MasterItemType::getClassForItemType()
Returns a new instance of the Class for the given Itentype ID.
MasterItemType::getClassNameForItemType()
Returns the Classname for the given Itentype ID.
MasterItemType::getCommandForItemType()
Return the Command for the given Itemtype ID.
MasterItemType::getDirectoryForItemType()
Return the Directory for the given Itemtype ID.
MasterItemType::getItemTypeForCommand()
Get the Itemtype ID for the given Command (or null).
MasterItemType::getSelectColumns()
Returns the Select Columns to be used for Item- and Treeselects.

[ Top ]
Method Summary
ItemService   ItemService()   Initalizes a new ItemService for the given Itemtype.
int   countAllItems()   Counts all Items, except TOP_LEVEL.
void   countLevel()   Calculates the Level beneath TOP LEVEL.
void   getItem()  
void   getItemLanguageEnumeration()  
void   getItemtype()  
void   getLastEditedItems()   Get the last edited Items for the specified Language.
void   getLightTree()  
void   getLightTreeForLanguage()  
void   getTree()  
void   getTreeForLanguage()  
void   getTreeWalker()  
array   getWayHome()  
void   increaseViewCounter()  
void   initItemService()  
boolean   isChildOf()   Returns true if "child" is somewhere beneath "parent" in the Menu Tree.
boolean   isLeaf()   Checks whether the given Item is a Leaf.

[ Top ]
Methods
Constructor ItemService  [line 45]

  ItemService ItemService( [ $itemtype = '']  )

Initalizes a new ItemService for the given Itemtype.

Parameters:
   $itemtype: 


[ Top ]
countAllItems  [line 143]

  int countAllItems( )

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.


API Tags:
Return:  the amount of all Items


[ Top ]
countLevel  [line 89]

  void countLevel( $item_id  )

Calculates the Level beneath TOP LEVEL.

Parameters:
   $item_id: 


[ Top ]
getItem  [line 57]

  void getItem( $item_id, [ $treetype = ITEM_LOAD_FULL], [ $languageID = '']  )

Parameters:
   $item_id: 
   $treetype: 
   $languageID: 


[ Top ]
getItemLanguageEnumeration  [line 81]

  void getItemLanguageEnumeration( $item_id  )

Parameters:
   $item_id: 


[ Top ]
getItemtype  [line 53]

  void getItemtype( )



[ Top ]
getLastEditedItems  [line 126]

  void getLastEditedItems( String $language_id, [ $start = '0'], [ $stop = '5']  )

Get the last edited Items for the specified Language.

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

Parameters:
String   $language_id:  language_id the Language ID
   $start: 
   $stop: 

API Tags:
Deprecated:  use the functions from classes.item.ItemRequests instead


[ Top ]
getLightTree  [line 69]

  void getLightTree( $id, [ $orderby = ORDER_COLUMN_POSITION]  )

Parameters:
   $id: 
   $orderby: 


[ Top ]
getLightTreeForLanguage  [line 77]

  void getLightTreeForLanguage( $id, $languageID, [ $orderby = ORDER_COLUMN_POSITION]  )

Parameters:
   $id: 
   $languageID: 
   $orderby: 


[ Top ]
getTree  [line 65]

  void getTree( $id, [ $orderby = ORDER_COLUMN_POSITION]  )

Parameters:
   $id: 
   $orderby: 


[ Top ]
getTreeForLanguage  [line 73]

  void getTreeForLanguage( $id, $languageID, [ $orderby = ORDER_COLUMN_POSITION]  )

Parameters:
   $id: 
   $languageID: 
   $orderby: 


[ Top ]
getTreeWalker  [line 61]

  void getTreeWalker( $id, [ $orderby = ORDER_COLUMN_POSITION]  )

Parameters:
   $id: 
   $orderby: 


[ Top ]
getWayHome  [line 99]

  array getWayHome( int $item_id, boolean $include  )

Parameters:
int   $item_id:  the Item ID to start from
boolean   $include:  whether to include the Start ID or not

API Tags:
Return:  an Array with Item ID for the Way Home


[ Top ]
increaseViewCounter  [line 212]

  void increaseViewCounter( $itemid, $language  )

Parameters:
   $itemid: 
   $language: 


[ Top ]
initItemService  [line 49]

  void initItemService( $itemtype  )

Parameters:
   $itemtype: 


[ Top ]
isChildOf  [line 190]

  boolean isChildOf( $parent_id, $child_id  )

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

This method is time consuming!

Parameters:
   $parent_id: 
   $child_id: 

API Tags:
Return:  whether child_id is a child of parent_id


[ Top ]
isLeaf  [line 167]

  boolean isLeaf( $itemID  )

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

Parameters:
   $itemID: 

API Tags:
Return:  TRUE if the Item has childs in any language, FALSE otherwise


[ Top ]