Joomla CMS  3.10.11 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.10.11 et du framework Joomla Platform intégré
Référence de la classe CategoriesModelCategory
+ Graphe d'héritage de CategoriesModelCategory:

Fonctions membres publiques

 __construct ($config=array())
 
 getTable ($type='Category', $prefix='CategoriesTable', $config=array())
 
 getItem ($pk=null)
 
 getForm ($data=array(), $loadData=true)
 
 validate ($form, $data, $group=null)
 
 save ($data)
 
 publish (&$pks, $value=1)
 
 rebuild ()
 
 saveorder ($idArray=null, $lftArray=null)
 
 getAssoc ()
 

Champs de données

 $typeAlias = null
 

Fonctions membres protégées

 canDelete ($record)
 
 canEditState ($record)
 
 populateState ()
 
 getReorderConditions ($table)
 
 loadFormData ()
 
 preprocessForm (JForm $form, $data, $group='content')
 
 batchFlipordering ($value, $pks, $contexts)
 
 batchCopy ($value, $pks, $contexts)
 
 batchMove ($value, $pks, $contexts)
 
 cleanCache ($group=null, $clientId=0)
 
 generateNewTitle ($parentId, $alias, $title)
 

Attributs protégés

 $text_prefix = 'COM_CATEGORIES'
 
 $associationsContext = 'com_categories.item'
 

Attributs privés

 $hasAssociation
 

Description détaillée

Categories Component Category Model

Depuis
1.6

Documentation des constructeurs et destructeur

◆ __construct()

__construct (   $config = array())

Override parent constructor.

Paramètres
array$configAn optional associative array of configuration settings.
Voir également
JModelLegacy
Depuis
3.2

Références $config, et $extension.

Documentation des fonctions membres

◆ batchCopy()

batchCopy (   $value,
  $pks,
  $contexts 
)
protected

Batch copy categories to a new category.

Paramètres
integer$valueThe new category.
array$pksAn array of row IDs.
array$contextsAn array of item contexts.
Renvoie
mixed An array of new IDs on success, boolean false on failure.
Depuis
1.6

Références $canCreate, $count, $db, $extension, $parts, $query, $title, $type, $value, elseif, et null.

◆ batchFlipordering()

batchFlipordering (   $value,
  $pks,
  $contexts 
)
protected

Batch flip category ordering.

Paramètres
integer$valueThe new category.
array$pksAn array of row IDs.
array$contextsAn array of item contexts.
Renvoie
mixed An array of new IDs on success, boolean false on failure.
Depuis
3.6.3

For each category get the max ordering value Re-order with max - ordering

Références $db, $id, $query, et false.

◆ batchMove()

batchMove (   $value,
  $pks,
  $contexts 
)
protected

Batch move categories to a new category.

Paramètres
integer$valueThe new category ID.
array$pksAn array of row IDs.
array$contextsAn array of item contexts.
Renvoie
boolean True on success.
Depuis
1.6

Références $canCreate, $db, $extension, $query, $type, et $value.

◆ canDelete()

canDelete (   $record)
protected

Method to test whether a record can be deleted.

Paramètres
object$recordA record object.
Renvoie
boolean True if allowed to delete the record. Defaults to the permission set in the component.
Depuis
1.6

◆ canEditState()

canEditState (   $record)
protected

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

Paramètres
object$recordA record object.
Renvoie
boolean True if allowed to change the state of the record. Defaults to the permission set in the component.
Depuis
1.6

Références $user.

◆ cleanCache()

cleanCache (   $group = null,
  $clientId = 0 
)
protected

Custom clean the cache of com_content and content modules

Paramètres
string$groupCache group name.
integer$clientIdApplication client id.
Renvoie
void
Depuis
1.6

Références $extension.

◆ generateNewTitle()

generateNewTitle (   $parentId,
  $alias,
  $title 
)
protected

Method to change the title & alias.

Paramètres
integer$parentIdThe id of the parent.
string$aliasThe alias.
string$titleThe title.
Renvoie
array Contains the modified title and alias.
Depuis
1.7

Références $title.

◆ getAssoc()

getAssoc ( )

Method to determine if a category association is available.

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

Références $component, $extension, JPATH_SITE, et JLoader\register().

◆ getForm()

getForm (   $data = array(),
  $loadData = true 
)

Method to get the row form.

Paramètres
array$dataData for the form.
boolean$loadDataTrue if the form is to load its own data (default case), false if not.
Renvoie
JForm|boolean A JForm object on success, false on failure
Depuis
1.6

Références $data, $extension, $form, $jinput, et $parts.

◆ getItem()

getItem (   $pk = null)

Method to get a category.

Paramètres
integer$pkAn optional id of the object to get, otherwise the id from the model state is used.
Renvoie
mixed Category data object on success, false on failure.
Depuis
1.6

Références $assoc, CategoriesHelper\getAssociations(), et null.

◆ getReorderConditions()

getReorderConditions (   $table)
protected

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ètres
JTableCategory$tableCurrent table instance
Renvoie
array An array of conditions to add to add to ordering queries.
Depuis
1.6

◆ getTable()

getTable (   $type = 'Category',
  $prefix = 'CategoriesTable',
  $config = array() 
)

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

Paramètres
string$typeThe table name. Optional.
string$prefixThe class prefix. Optional.
array$configConfiguration array for model. Optional.
Renvoie
JTable A JTable object
Depuis
1.6

Références $config, $prefix, et $type.

◆ loadFormData()

loadFormData ( )
protected

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

Renvoie
mixed The data for the form.
Depuis
1.6

Références $app, $data, $extension, $filters, et null.

◆ populateState()

populateState ( )
protected

Auto-populate the model state.

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

Renvoie
void
Depuis
1.6

Références $app, $extension, $params, $parts, et null.

◆ preprocessForm()

preprocessForm ( JForm  $form,
  $data,
  $group = 'content' 
)
protected

Method to preprocess the form.

Paramètres
JForm$formA JForm object.
mixed$dataThe data expected for the form.
string$groupThe name of the plugin group to import.
Renvoie
mixed
Voir également
JFormField
Depuis
1.6
Exceptions
Exceptionif there is an error in the form event.

Références $component, $data, $extension, $field, $fields, $form, $lang, $language, $name, $path, $section, jimport(), JPATH_ADMINISTRATOR, JPATH_BASE, null, et JLoader\register().

◆ publish()

publish ( $pks,
  $value = 1 
)

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

Paramètres
array$pksA list of the primary keys to change.
integer$valueThe value of the published state.
Renvoie
boolean True on success.
Depuis
2.5

Références $dispatcher, $extension, $value, et JEventDispatcher\getInstance().

◆ rebuild()

rebuild ( )

Method rebuild the entire nested set tree.

Renvoie
boolean False on failure or error, true otherwise.
Depuis
1.6

◆ save()

save (   $data)

Method to save the form data.

Paramètres
array$dataThe form data.
Renvoie
boolean True on success.
Depuis
1.6

Références $assoc, $context, $data, $db, $dispatcher, $id, $input, $key, $name, $query, $title, JEventDispatcher\getInstance(), json_encode, option, JError\raiseNotice(), et ArrayHelper\toInteger().

◆ saveorder()

saveorder (   $idArray = null,
  $lftArray = null 
)

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ètres
array$idArrayAn array of primary key ids.
integer$lftArrayThe lft value
Renvoie
boolean False on failure or error, True otherwise
Depuis
1.6

◆ validate()

validate (   $form,
  $data,
  $group = null 
)

Method to validate the form data.

Paramètres
JForm$formThe form to validate against.
array$dataThe data to validate.
string$groupThe name of the field group to validate.
Renvoie
array|boolean Array of filtered data if valid, false otherwise.
Voir également
JFormRule
JFilterInput
Depuis
3.9.23

Références $data, $form, et validate().

Documentation des champs

◆ $associationsContext

$associationsContext = 'com_categories.item'
protected

◆ $hasAssociation

$hasAssociation
private

◆ $text_prefix

$text_prefix = 'COM_CATEGORIES'
protected

◆ $typeAlias

$typeAlias = null

La documentation de cette classe a été générée à partir du fichier suivant :