Class ContentModelCategory

Description

This models supports retrieving a category, the articles associated with the category, sibling, child and parent categories.

  • since: 1.5

Located in /components/com_content/models/category.php (line 20)

JObject
   |
   --JModelLegacy
      |
      --JModelList
         |
         --ContentModelCategory
Variable Summary
 mixed $_articles
 array $_categories
 object $_category
 mixed $_children
 string $_context
 array $_item
 mixed $_parent
 mixed $_siblings
Method Summary
 ContentModelCategory __construct ([array $config = array()])
 object getCategory (integer 0)
 mixed &getChildren (integer 0)
 mixed getItems ()
 mixed &getLeftSibling ()
 void getPagination ()
 mixed getParent (integer 0)
 mixed &getRightSibling ()
 boolean hit ([int $pk = 0])
 void populateState ([ $ordering = null], [ $direction = null])
Variables
mixed $_articles = null (line 29)
  • access: protected
array $_categories = null (line 58)

The list of other newfeed categories.

  • access: protected
object $_category = null (line 50)

The category that applies.

  • access: protected
mixed $_children = null (line 33)
  • access: protected
string $_context = 'com_content.category' (line 42)

Model context string.

  • access: protected
array $_item = null (line 27)

Category items data

  • access: protected
mixed $_parent = null (line 35)
  • access: protected
mixed $_siblings = null (line 31)
  • access: protected

Inherited Variables

Inherited from JModelList

JModelList::$cache
JModelList::$context
JModelList::$filterFormName
JModelList::$filter_fields
JModelList::$htmlFormName
JModelList::$query

Inherited from JModelLegacy

JModelLegacy::$event_clean_cache
JModelLegacy::$name
JModelLegacy::$option
JModelLegacy::$state
JModelLegacy::$_db
JModelLegacy::$__state_set

Inherited from JObject

JObject::$_errors
Methods
Constructor __construct (line 67)

Constructor.

ContentModelCategory __construct ([array $config = array()])
  • array $config: An optional associative array of configuration settings.

Redefinition of:
JModelList::__construct()
Constructor.
getCategory (line 311)

Method to get category data for the current category

  • since: 1.5
  • access: public
object getCategory (integer 0)
  • integer 0: An optional ID
getChildren (line 419)

Get the child categories.

  • return: An array of categories or false if an error occurs.
  • since: 1.6
mixed &getChildren (integer 0)
  • integer 0: An optional category id. If not supplied, the model state 'category.id' will be used.
getItems (line 210)

Get the articles in the category

  • return: An array of articles or false if an error occurs.
  • since: 1.5
mixed getItems ()

Redefinition of:
JModelList::getItems()
Method to get an array of data items.
getLeftSibling (line 385)

Get the left sibling (adjacent) categories.

  • return: An array of categories or false if an error occurs.
  • since: 1.6
mixed &getLeftSibling ()
getPagination (line 294)
  • access: public
void getPagination ()

Redefinition of:
JModelList::getPagination()
Method to get a JPagination object for the data set.
getParent (line 369)

Get the parent category.

  • return: An array of categories or false if an error occurs.
  • since: 1.6
  • access: public
mixed getParent (integer 0)
  • integer 0: An optional category id. If not supplied, the model state 'category.id' will be used.
getRightSibling (line 401)

Get the right sibling (adjacent) categories.

  • return: An array of categories or false if an error occurs.
  • since: 1.6
mixed &getRightSibling ()
hit (line 447)

Increment the hit counter for the category.

  • return: True if successful; false otherwise and internal error set.
  • access: public
boolean hit ([int $pk = 0])
  • int $pk: Optional primary key of the category to increment.
populateState (line 104)

Method to auto-populate the model state.

Note. Calling getState in this method will result in recursion.

return void

  • since: 1.6
  • access: protected
void populateState ([ $ordering = null], [ $direction = null])
  • $ordering
  • $direction

Redefinition of:
JModelList::populateState()
Method to auto-populate the model state.
_buildContentOrderBy (line 258)

Build the orderby for the query

  • return: portion of query
  • since: 1.5
  • access: protected
string _buildContentOrderBy ()

Inherited Methods

Inherited From JModelList

 JModelList::__construct()
 JModelList::getActiveFilters()
 JModelList::getFilterForm()
 JModelList::getItems()
 JModelList::getListQuery()
 JModelList::getPagination()
 JModelList::getStart()
 JModelList::getStoreId()
 JModelList::getTotal()
 JModelList::getUserStateFromRequest()
 JModelList::loadForm()
 JModelList::loadFormData()
 JModelList::populateState()
 JModelList::preprocessForm()
 JModelList::_getListQuery()

Inherited From JModelLegacy

 JModelLegacy::__construct()
 JModelLegacy::addIncludePath()
 JModelLegacy::addTablePath()
 JModelLegacy::cleanCache()
 JModelLegacy::getDbo()
 JModelLegacy::getInstance()
 JModelLegacy::getName()
 JModelLegacy::getState()
 JModelLegacy::getTable()
 JModelLegacy::loadHistory()
 JModelLegacy::populateState()
 JModelLegacy::setDbo()
 JModelLegacy::setState()
 JModelLegacy::_createFileName()
 JModelLegacy::_createTable()
 JModelLegacy::_getList()
 JModelLegacy::_getListCount()

Inherited From JObject

 JObject::__construct()
 JObject::def()
 JObject::get()
 JObject::getError()
 JObject::getErrors()
 JObject::getProperties()
 JObject::set()
 JObject::setError()
 JObject::setProperties()
 JObject::__toString()

Documentation generated on Tue, 19 Nov 2013 14:55:26 +0100 by phpDocumentor 1.4.3