[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_categories/src/Model/ -> CategoryModel.php (summary)

(no description)

Copyright: (C) 2008 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
File Size: 1286 lines (44 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

CategoryModel:: (21 methods):
  __construct()
  canDelete()
  canEditState()
  getTable()
  populateState()
  getItem()
  getForm()
  getReorderConditions()
  loadFormData()
  validate()
  preprocessForm()
  save()
  publish()
  rebuild()
  saveorder()
  batchFlipordering()
  batchCopy()
  batchMove()
  cleanCache()
  generateNewTitle()
  getAssoc()


Class: CategoryModel  - X-Ref

Categories Component Category Model

__construct($config = array()   X-Ref
Override parent constructor.

param: array                     $config   An optional associative array of configuration settings.
param: MVCFactoryInterface|null  $factory  The factory.

canDelete($record)   X-Ref
Method to test whether a record can be deleted.

param: object  $record  A record object.
return: boolean  True if allowed to delete the record. Defaults to the permission set in the component.

canEditState($record)   X-Ref
Method to test whether a record can have its state changed.

param: object  $record  A record object.
return: boolean  True if allowed to change the state of the record. Defaults to the permission set in the component.

getTable($type = 'Category', $prefix = 'Administrator', $config = array()   X-Ref
Method to get a table object, load it if necessary.

param: string  $type    The table name. Optional.
param: string  $prefix  The class prefix. Optional.
param: array   $config  Configuration array for model. Optional.
return: \Joomla\CMS\Table\Table  A Table object

populateState()   X-Ref
Auto-populate the model state.

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

return: void

getItem($pk = null)   X-Ref
Method to get a category.

param: integer  $pk  An optional id of the object to get, otherwise the id from the model state is used.
return: mixed    Category data object on success, false on failure.

getForm($data = array()   X-Ref
Method to get the row form.

param: array    $data      Data for the form.
param: boolean  $loadData  True if the form is to load its own data (default case), false if not.
return: Form|boolean  A JForm object on success, false on failure

getReorderConditions($table)   X-Ref
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

param: Category  $table  Current table instance
return: array  An array of conditions to add to ordering queries.

loadFormData()   X-Ref
Method to get the data that should be injected in the form.

return: mixed  The data for the form.

validate($form, $data, $group = null)   X-Ref
Method to validate the form data.

param: Form    $form   The form to validate against.
param: array   $data   The data to validate.
param: string  $group  The name of the field group to validate.
return: array|boolean  Array of filtered data if valid, false otherwise.

preprocessForm(Form $form, $data, $group = 'content')   X-Ref
Method to preprocess the form.

param: Form    $form  A Form object.
param: mixed   $data  The data expected for the form.
param: string  $group The name of the plugin group to import.
return: mixed

save($data)   X-Ref
Method to save the form data.

param: array  $data  The form data.
return: boolean  True on success.

publish(&$pks, $value = 1)   X-Ref
Method to change the published state of one or more records.

param: array    $pks    A list of the primary keys to change.
param: integer  $value  The value of the published state.
return: boolean  True on success.

rebuild()   X-Ref
Method rebuild the entire nested set tree.

return: boolean  False on failure or error, true otherwise.

saveorder($idArray = null, $lftArray = null)   X-Ref
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.

param: array    $idArray   An array of primary key ids.
param: integer  $lftArray  The lft value
return: boolean  False on failure or error, True otherwise

batchFlipordering($value, $pks, $contexts)   X-Ref
Batch flip category ordering.

param: integer  $value     The new category.
param: array    $pks       An array of row IDs.
param: array    $contexts  An array of item contexts.
return: mixed    An array of new IDs on success, boolean false on failure.

batchCopy($value, $pks, $contexts)   X-Ref
Batch copy categories to a new category.

param: integer  $value     The new category.
param: array    $pks       An array of row IDs.
param: array    $contexts  An array of item contexts.
return: mixed    An array of new IDs on success, boolean false on failure.

batchMove($value, $pks, $contexts)   X-Ref
Batch move categories to a new category.

param: integer  $value     The new category ID.
param: array    $pks       An array of row IDs.
param: array    $contexts  An array of item contexts.
return: boolean  True on success.

cleanCache($group = null, $clientId = 0)   X-Ref
Custom clean the cache of com_content and content modules

param: string   $group     Cache group name.
param: integer  $clientId  @deprecated   5.0   No longer used.
return: void

generateNewTitle($parentId, $alias, $title)   X-Ref
Method to change the title & alias.

param: integer  $parentId  The id of the parent.
param: string   $alias     The alias.
param: string   $title     The title.
return: array    Contains the modified title and alias.

getAssoc()   X-Ref
Method to determine if a category association is available.

return: boolean True if a category association is available; false otherwise.



Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer