Class CategoriesModelCategory

Description

Categories Component Category Model

  • since: 1.6

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

JObject
   |
   --JModelLegacy
      |
      --JModelForm
         |
         --JModelAdmin
            |
            --CategoriesModelCategory
Variable Summary
 string $text_prefix
 string $typeAlias
Method Summary
 CategoriesModelCategory __construct ([array $config = array()])
 mixed batchCopy (integer $value, array $pks, array $contexts)
 boolean batchMove (integer $value, array $pks, array $contexts)
 void batchTag ( $value,  $pks,  $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)
 void getAssoc ()
 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, [string $group = 'content'])
 boolean publish (array &$pks, [integer $value = 1])
 boolean rebuild ()
 boolean save (array $data)
 boolean saveorder ([array $idArray = null], [integer $lft_array = null])
Variables
string $text_prefix = 'COM_CATEGORIES' (line 25)
  • 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.
string $typeAlias = null (line 33)

The type alias for this content type. Used for content version history.

  • since: 3.2
  • access: public

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

Override parent constructor.

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

Redefinition of:
JModelAdmin::__construct()
Constructor.
batchCopy (line 737)

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

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.
batchTag (line 685)
  • access: protected
void batchTag ( $value,  $pks,  $contexts)
  • $value
  • $pks
  • $contexts
canDelete (line 59)

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.
canEditState (line 82)

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.
cleanCache (line 1067)

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:
JModelLegacy::cleanCache()
Clean the cache
generateNewTitle (line 1098)

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.
getAssoc (line 1111)
  • access: public
void getAssoc ()
getForm (line 239)

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

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.
getReorderConditions (line 293)

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
getTable (line 114)

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:
JModelLegacy::getTable()
Method to get a table object, load it if necessary.
loadFormData (line 305)

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

Auto-populate the model state.

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

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

Redefinition of:
JModelLegacy::populateState()
Method to auto-populate the model state.
preprocessForm (line 333)

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, [string $group = 'content'])
  • JForm $form: A JForm object.
  • mixed $data: The data expected for the form.
  • string $group: The name of the plugin group to import.

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

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

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

Method rebuild the entire nested set tree.

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

Method to save the form data.

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

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

Inherited Methods

Inherited From JModelAdmin

 JModelAdmin::__construct()
 JModelAdmin::batch()
 JModelAdmin::batchAccess()
 JModelAdmin::batchCopy()

Inherited From JModelForm

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

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:35 +0100 by phpDocumentor 1.4.3