Class CategoriesModelCategory

Description

Categories Component Category Model

  • since: 1.6

Located in /administrator/components/com_categories/models/category.php (line 22)

JObject
   |
   --JModel
      |
      --JModelForm
         |
         --JModelAdmin
            |
            --CategoriesModelCategory
Variable Summary
string $text_prefix
Method Summary
mixed batchCopy (integer $value, array $pks, array $contexts)
boolean batchMove (integer $value, array $pks, array $contexts)
boolean canDelete (object $record)
boolean canEditState (object $record)
void cleanCache ([ $group = null], [ $client_id = 0])
array generateNewTitle (integer $parent_id, string $alias, string $title)
mixed getForm ([array $data = array()], [boolean $loadData = true])
mixed getItem ([integer $pk = null])
array getReorderConditions (JCategoryTable $table)
JTable getTable ([string $type = 'Category'], [string $prefix = 'CategoriesTable'], [array $config = array()])
mixed loadFormData ()
void populateState ()
void preprocessForm (JForm $form, mixed $data, [ $group = 'content'], string $groups)
boolean publish ( &$pks, [integer $value = 1], array $pks)
boolean rebuild ()
boolean save (array $data)
boolean saveorder ([array $idArray = null], [integer $lft_array = null])
Variables
string $text_prefix = 'COM_CATEGORIES' (line 28)
  • var: The prefix to use with controller messages.
  • since: 1.6
  • access: protected

Redefinition of:
JModelAdmin::$text_prefix
The prefix to use with controller messages.

Inherited Variables

Inherited from JModelAdmin

JModelAdmin::$event_after_delete
JModelAdmin::$event_after_save
JModelAdmin::$event_before_delete
JModelAdmin::$event_before_save
JModelAdmin::$event_change_state

Inherited from JModelForm

JModelForm::$_forms

Inherited from JModel

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

Inherited from JObject

JObject::$_errors
Methods
batchCopy (line 553)

Batch copy categories to a new category.

  • return: An array of new IDs on success, boolean false on failure.
  • since: 1.6
  • access: protected
mixed batchCopy (integer $value, array $pks, array $contexts)
  • integer $value: The new category.
  • array $pks: An array of row IDs.
  • array $contexts: An array of item contexts.

Redefinition of:
JModelAdmin::batchCopy()
Batch copy items to a new category or current.
batchMove (line 741)

Batch move categories to a new category.

  • return: True on success.
  • since: 1.6
  • access: protected
boolean batchMove (integer $value, array $pks, array $contexts)
  • integer $value: The new category ID.
  • array $pks: An array of row IDs.
  • array $contexts: An array of item contexts.

Redefinition of:
JModelAdmin::batchMove()
Batch move items to a new category
canDelete (line 39)

Method to test whether a record can be deleted.

  • return: True if allowed to delete the record. Defaults to the permission set in the component.
  • since: 1.6
  • access: protected
boolean canDelete (object $record)
  • object $record: A record object.

Redefinition of:
JModelAdmin::canDelete()
Method to test whether a record can be deleted.
canEditState (line 62)

Method to test whether a record can have its state changed.

  • return: True if allowed to change the state of the record. Defaults to the permission set in the component.
  • since: 1.6
  • access: protected
boolean canEditState (object $record)
  • object $record: A record object.

Redefinition of:
JModelAdmin::canEditState()
Method to test whether a record can be deleted.
cleanCache (line 868)

Custom clean the cache of com_content and content modules

  • since: 1.6
  • access: protected
void cleanCache ([ $group = null], [ $client_id = 0])
  • $group
  • $client_id

Redefinition of:
JModel::cleanCache()
Clean the cache
generateNewTitle (line 899)

Method to change the title & alias.

  • return: Contains the modified title and alias.
  • since: 1.7
  • access: protected
array generateNewTitle (integer $parent_id, string $alias, string $title)
  • integer $parent_id: The id of the parent.
  • string $alias: The alias.
  • string $title: The title.

Redefinition of:
JModelAdmin::generateNewTitle()
Method to change the title & alias.
getForm (line 200)

Method to get the row form.

  • return: A JForm object on success, false on failure
  • since: 1.6
  • access: public
mixed getForm ([array $data = array()], [boolean $loadData = true])
  • array $data: Data for the form.
  • boolean $loadData: True if the form is to load its own data (default case), false if not.

Redefinition of:
JModelForm::getForm()
Abstract method for getting the form from the model.
getItem (line 143)

Method to get a category.

  • return: Category data object on success, false on failure.
  • since: 1.6
  • access: public
mixed getItem ([integer $pk = null])
  • integer $pk: An optional id of the object to get, otherwise the id from the model state is used.

Redefinition of:
JModelAdmin::getItem()
Method to get a single record.
getReorderConditions (line 255)

A protected method to get the where clause for the reorder This ensures that the row will be moved relative to a row with the same extension

  • return: An array of conditions to add to add to ordering queries.
  • since: 1.6
  • access: protected
array getReorderConditions (JCategoryTable $table)
  • JCategoryTable $table: Current table instance

Redefinition of:
JModelAdmin::getReorderConditions()
A protected method to get a set of ordering conditions.
getTable (line 94)

Method to get a table object, load it if necessary.

  • return: A JTable object
  • since: 1.6
  • access: public
JTable getTable ([string $type = 'Category'], [string $prefix = 'CategoriesTable'], [array $config = array()])
  • string $type: The table name. Optional.
  • string $prefix: The class prefix. Optional.
  • array $config: Configuration array for model. Optional.

Redefinition of:
JModel::getTable()
Method to get a table object, load it if necessary.
loadFormData (line 267)

Method to get the data that should be injected in the form.

  • return: The data for the form.
  • since: 1.6
  • access: protected
mixed loadFormData ()

Redefinition of:
JModelForm::loadFormData()
Method to get the data that should be injected in the form.
populateState (line 108)

Auto-populate the model state.

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

  • since: 1.6
  • access: protected
void populateState ()

Redefinition of:
JModelAdmin::populateState()
Stock method to auto-populate the model state.
preprocessForm (line 293)

Method to preprocess the form.

  • see: JFormField
  • throws: Exception if there is an error in the form event.
  • since: 1.6
  • access: protected
void preprocessForm (JForm $form, mixed $data, [ $group = 'content'], string $groups)
  • JForm $form: A JForm object.
  • mixed $data: The data expected for the form.
  • string $groups: The name of the plugin group to import.
  • $group

Redefinition of:
JModelForm::preprocessForm()
Method to allow derived classes to preprocess the form.
publish (line 472)

Method to change the published state of one or more records.

  • return: True on success.
  • since: 2.5
boolean publish ( &$pks, [integer $value = 1], array $pks)
  • array $pks: A list of the primary keys to change.
  • integer $value: The value of the published state.
  • &$pks

Redefinition of:
JModelAdmin::publish()
Method to change the published state of one or more records.
rebuild (line 496)

Method rebuild the entire nested set tree.

  • return: False on failure or error, true otherwise.
  • since: 1.6
  • access: public
boolean rebuild ()
save (line 369)

Method to save the form data.

  • return: True on success.
  • since: 1.6
  • access: public
boolean save (array $data)
  • array $data: The form data.

Redefinition of:
JModelAdmin::save()
Method to save the form data.
saveorder (line 525)

Method to save the reordered nested set tree.

First we save the new order values in the lft values of the changed ids. Then we invoke the table rebuild to implement the new ordering.

  • return: False on failure or error, True otherwise
  • since: 1.6
  • access: public
boolean saveorder ([array $idArray = null], [integer $lft_array = null])
  • array $idArray: An array of primary key ids.
  • integer $lft_array: The lft value

Redefinition of:
JModelAdmin::saveorder()
Saves the manually set order of records.

Inherited Methods

Inherited From JModelAdmin

JModelAdmin::__construct()
JModelAdmin::batch()
JModelAdmin::batchAccess()
JModelAdmin::batchCopy()
JModelAdmin::batchLanguage()
JModelAdmin::batchMove()
JModelAdmin::canDelete()
JModelAdmin::canEditState()
JModelAdmin::checkin()
JModelAdmin::checkout()
JModelAdmin::delete()
JModelAdmin::generateNewTitle()
JModelAdmin::getItem()
JModelAdmin::getReorderConditions()
JModelAdmin::populateState()
JModelAdmin::prepareTable()
JModelAdmin::publish()
JModelAdmin::reorder()
JModelAdmin::save()
JModelAdmin::saveorder()

Inherited From JModelForm

JModelForm::checkin()
JModelForm::checkout()
JModelForm::getForm()
JModelForm::loadForm()
JModelForm::loadFormData()
JModelForm::preprocessForm()
JModelForm::validate()

Inherited From JModel

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

Inherited From JObject

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

Documentation generated on Mon, 25 Jun 2012 13:52:53 -0500 by phpDocumentor 1.4.4