Class SGL_Item

Description

Acts as a wrapper for content objects.

Located in /SGL/Item.php (line 49)


	
			
Variable Summary
 int $catID
 mixed $dateCreated
 mixed $expiryDate
 int $id
 mixed $lastUpdated
 mixed $startDate
 int $statusID
 string $type
 int $typeID
Method Summary
 static array retrievePaginated (int $catID, [ $bPublished = false], [int $dataTypeID = 1], [string $queryRange = 'thisCategory'], [int $from = ''], [string $orderBy = 'last_updated'])
 void SGL_Item ([int $itemID = -1], [string $language = null], [ $onlyPublished = false])
 void addDataItems (int $parentID, int $itemID, mixed $itemValue,  $itemType, string $language)
 int addMetaItems ()
 void changeStatus (string $status)
 void delete (array $aItems)
 mixed generateFormFields (int $fieldID, string $fieldName, [mixed $fieldValue = ''], int $fieldType, string $language)
 array generateItemOutput (int $fieldID, string $fieldName, mixed $fieldValue, int $itemTypeID)
 mixed get (string $attribute)
 mixed getDynamicContent (int $itemID, [int $type = SGL_RET_STRING], string $language)
 mixed getDynamicFields (int $typeID, [int $type = SGL_RET_STRING], string $language)
 array getItemDetail ([int $itemID = null], [boolean $bPublished = null], [string $language = null])
 array getItemListByCatID (int $catID, int $dataTypeID, int $mostRecentArticleID)
 array manualPreview ()
 mixed preview ([boolean $bPublished = false], [string $language = null])
 void set (string $attributeName, mixed $attributeValue)
 void updateDataItems (int $itemID, mixed $itemValue,  $itemType, string $language)
 voide updateMetaItems ()
 void _init (int $itemID, [ $languageID = null],  $onlyPublished, string $language)
Variables
int $catID (line 121)

Category ID

  • access: public
mixed $dateCreated (line 73)

Timestamp an Item was created

  • access: public
mixed $expiryDate (line 97)

Timestamp when an Item expires

  • access: public
int $id (line 57)

Item ID

  • access: public
mixed $lastUpdated (line 81)

Timestamp of last update for an Item

  • access: public
int $lastUpdatedById (line 65)

User ID of user to last update item

  • access: public
mixed $startDate (line 89)

Timestamp when an Item becomes available

  • access: public
int $statusID (line 129)

Status ID

string $type (line 105)

Item Type Name

  • access: public
int $typeID (line 113)

Item Type ID

  • access: public
Methods
static retrievePaginated (line 926)

Gets paginated list of articles.

  • return: returns array of article objects, pager data, and show page flag
  • see: retrieveAll()
  • access: public
array retrievePaginated (int $catID, [ $bPublished = false], [int $dataTypeID = 1], [string $queryRange = 'thisCategory'], [int $from = ''], [string $orderBy = 'last_updated'])
  • int $dataTypeID: template ID of article, ie, news article, weather article, etc.
  • string $queryRange: flag to indicate if results limited to specific category
  • int $catID: optional cat ID to limit results to
  • int $from: row ID offset for pagination
  • string $orderBy: column to sort on
  • $bPublished
Constructor SGL_Item (line 139)

Constructor

  • access: public
void SGL_Item ([int $itemID = -1], [string $language = null], [ $onlyPublished = false])
  • int $itemID: ItemID
  • string $language: Language
  • $onlyPublished
addDataItems (line 280)

Inserts Data Items into item_addtion table.

  • access: public
void addDataItems (int $parentID, int $itemID, mixed $itemValue,  $itemType, string $language)
  • int $parentID: Parent ID
  • int $itemID: Item ID
  • mixed $itemValue: Item Value
  • string $language: Language
  • $itemType
addMetaItems (line 236)

Inserts Meta Items into item table.

  • return: Item ID
  • access: public
int addMetaItems ()
changeStatus (line 627)

Updates an Items Status (delete, approve, publish, archive) in the item table.

  • access: public
void changeStatus (string $status)
  • string $status: Item Status
delete (line 404)

Deletes an Item from the item and item_addition table. If safe delete is enabled only updates the items status to 0.

  • access: public
void delete (array $aItems)
  • array $aItems: Hash of IDs to delete.
generateFormFields (line 595)

Generates the form fields from the item_type_mapping table for the methods getDynamicContent() and getDynamicFields.

  • return: HTML Form
  • access: public
mixed generateFormFields (int $fieldID, string $fieldName, [mixed $fieldValue = ''], int $fieldType, string $language)
  • int $fieldID: Field ID
  • string $fieldName: Field Name
  • mixed $fieldValue: Field Value
  • int $fieldType: Field Type
  • string $language: Language
generateItemOutput (line 773)

Generates the output for an Item using the template defined below.

  • access: public
array generateItemOutput (int $fieldID, string $fieldName, mixed $fieldValue, int $itemTypeID)
  • int $fieldID: Field ID
  • string $fieldName: Field Name
  • mixed $fieldValue: Field Value
  • int $itemTypeID: Item Type ID
get (line 838)

Retrieves an Item's Meta Data value

  • access: public
mixed get (string $attribute)
  • string $attribute
getDynamicContent (line 454)

Builds a HTML form containing the data from the item_addition table. The input types are built using the data in the item_type and item_type_mapping tables.

  • return: HTML Form or Array
  • access: public
mixed getDynamicContent (int $itemID, [int $type = SGL_RET_STRING], string $language)
  • int $itemID: Item ID
  • int $type: data type to return, can be SGL_RET_STRING or SGL_RET_ARRAY
  • string $language: Language
getDynamicFields (line 529)

Builds a HTML form with the input types built using the data in the item_type and item_type_mapping tables.

  • return: HTML Form or Array
  • access: public
mixed getDynamicFields (int $typeID, [int $type = SGL_RET_STRING], string $language)
  • int $typeID: Item Type ID
  • int $type: data type to return, can be SGL_RET_STRING or SGL_RET_ARRAY
  • string $language: Language
getItemDetail (line 883)

Retrieve an Items Meta and Data details.

  • return: Array containg an Item's Details or false
  • access: public
array getItemDetail ([int $itemID = null], [boolean $bPublished = null], [string $language = null])
  • int $itemID: Item ID
  • boolean $bPublished: Item Published
  • string $language: Language
getItemListByCatID (line 853)

Retrieve a list of Items by CatID

array getItemListByCatID (int $catID, int $dataTypeID, int $mostRecentArticleID)
  • int $catID
  • int $dataTypeID
  • int $mostRecentArticleID
manualPreview (line 736)

Retierves and returns an array containing an an Item's Meta and Data items.

  • access: public
array manualPreview ()
preview (line 682)

Retierves an Item's Meta and Data items and generates the output using the method generateItemOutput().

  • return: HTML Output or false if article not loaded by constructor.
  • see: init()
  • access: public
mixed preview ([boolean $bPublished = false], [string $language = null])
  • boolean $bPublished: Item published
  • string $language: Language
set (line 826)

Sets an Item's Meta Data value

  • access: public
void set (string $attributeName, mixed $attributeValue)
  • string $attributeName
  • mixed $attributeValue
updateDataItems (line 355)

Update Data Items in item_addition table.

  • access: public
void updateDataItems (int $itemID, mixed $itemValue,  $itemType, string $language)
  • int $itemID: Item ID
  • mixed $itemValue: Item Value
  • string $language: Language
  • $itemType
updateMetaItems (line 329)

Update Meta Items in item table.

  • access: public
voide updateMetaItems ()
_init (line 168)

Retrieves an Item's Meta Data. Sets the corrisponding class variables.

  • access: private
void _init (int $itemID, [ $languageID = null],  $onlyPublished, string $language)
  • int $itemID: ItemID
  • string $language: Language
  • $languageID
  • $onlyPublished

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