Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Référence de la classe CategoryModel
+ Graphe d'héritage de CategoryModel:

Fonctions membres publiques

 __construct ($config=array(), MVCFactoryInterface $factory=null)
 
 getTable ($type='Category', $prefix='Administrator', $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 ()
 
- Fonctions membres publiques hérités de AdminModel
 __construct ($config=array(), MVCFactoryInterface $factory=null, FormFactoryInterface $formFactory=null)
 
 batch ($commands, $pks, $contexts)
 
 checkin ($pks=array())
 
 checkout ($pk=null)
 
 delete (&$pks)
 
 getItem ($pk=null)
 
 publish (&$pks, $value=1)
 
 reorder ($pks, $delta=0)
 
 save ($data)
 
 saveorder ($pks=array(), $order=null)
 
 generateTitle ($categoryId, $table)
 
 initBatch ()
 
 editAssociations ($data)
 
- Fonctions membres publiques hérités de FormModel
 __construct ($config=array(), MVCFactoryInterface $factory=null, FormFactoryInterface $formFactory=null)
 
 checkin ($pk=null)
 
 checkout ($pk=null)
 
 validate ($form, $data, $group=null)
 
- Fonctions membres publiques hérités de BaseDatabaseModel
 __construct ($config=array(), MVCFactoryInterface $factory=null)
 
 getTable ($name='', $prefix='', $options=array())
 
 isCheckedOut ($item)
 
 getDbo ()
 
 setDbo (DatabaseInterface $db=null)
 
 __get ($name)
 
- Fonctions membres publiques hérités de BaseModel
 __construct ($config=array())
 
 getName ()
 
- Fonctions membres publiques hérités de CMSObject
 __construct ($properties=null)
 
 __toString ()
 
 def ($property, $default=null)
 
 get ($property, $default=null)
 
 getProperties ($public=true)
 
 getError ($i=null, $toString=true)
 
 getErrors ()
 
 set ($property, $value=null)
 
 setProperties ($properties)
 
 setError ($error)
 
- Fonctions membres publiques hérités de StatefulModelInterface
 getState ($property=null, $default=null)
 
 setState ($property, $value=null)
 
- Fonctions membres publiques hérités de DispatcherAwareInterface
 setDispatcher (DispatcherInterface $dispatcher)
 
- Fonctions membres publiques hérités de CurrentUserInterface
 setCurrentUser (User $currentUser)
 
- Fonctions membres publiques hérités de CacheControllerFactoryAwareInterface
 setCacheControllerFactory (CacheControllerFactoryInterface $factory)
 
- Fonctions membres publiques hérités de DatabaseAwareInterface
 setDatabase (DatabaseInterface $db)
 
- Fonctions membres publiques hérités de FormFactoryAwareInterface
 setFormFactory (FormFactoryInterface $factory)
 

Champs de données

 $typeAlias = null
 
- Champs de données hérités de AdminModel
 $typeAlias
 

Fonctions membres protégées

 canDelete ($record)
 
 canEditState ($record)
 
 populateState ()
 
 getReorderConditions ($table)
 
 loadFormData ()
 
 preprocessForm (Form $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)
 
- Fonctions membres protégées hérités de AdminModel
 batchAccess ($value, $pks, $contexts)
 
 batchCopy ($value, $pks, $contexts)
 
 cleanupPostBatchCopy (TableInterface $table, $newId, $oldId)
 
 batchLanguage ($value, $pks, $contexts)
 
 batchMove ($value, $pks, $contexts)
 
 batchTag ($value, $pks, $contexts)
 
 canDelete ($record)
 
 canEditState ($record)
 
 generateNewTitle ($categoryId, $alias, $title)
 
 getReorderConditions ($table)
 
 populateState ()
 
 prepareTable ($table)
 
 checkCategoryId ($categoryId)
 
 redirectToAssociations ($data)
 
- Fonctions membres protégées hérités de BaseDatabaseModel
 _getList ($query, $limitstart=0, $limit=0)
 
 _getListCount ($query)
 
 _createTable ($name, $prefix='Table', $config=array())
 
 bootComponent ($component)
 
 dispatchEvent (EventInterface $event)
 

Attributs protégés

 $text_prefix = 'COM_CATEGORIES'
 
 $associationsContext = 'com_categories.item'
 
- Attributs protégés hérités de AdminModel
 $text_prefix = null
 
 $event_after_delete = null
 
 $event_after_save = null
 
 $event_before_delete = null
 
 $event_before_save = null
 
 $event_before_change_state = null
 
 $event_change_state = null
 
 $event_before_batch = null
 
 $batch_copymove = 'category_id'
 
 $batch_commands
 
 $associationsContext = null
 
 $batchSet = null
 
 $user = null
 
 $table = null
 
 $tableClassName = null
 
 $contentType = null
 
 $type = null
 
- Attributs protégés hérités de FormModel
 $events_map = null
 
- Attributs protégés hérités de BaseDatabaseModel
 $option = null
 
 $event_clean_cache = null
 
- Attributs protégés hérités de BaseModel
 $name
 
- Attributs protégés hérités de CMSObject
 $_errors = array()
 

Attributs privés

 $hasAssociation
 

Membres hérités additionnels

- Fonctions membres publiques statiques hérités de BaseModel
static addIncludePath ($path='', $prefix='')
 
- Attributs protégés statiques hérités de BaseModel
static $paths
 

Description détaillée

Categories Component Category Model

Depuis
1.6

Documentation des constructeurs et destructeur

◆ __construct()

__construct (   $config = array(),
MVCFactoryInterface  $factory = null 
)

Override parent constructor.

Paramètres
array$configAn optional associative array of configuration settings.
MVCFactoryInterface | null$factoryThe factory.
Voir également
Depuis
3.2

Références $config, $extension, Symfony\Contracts\Service\__construct(), et Factory\getApplication().

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, $this, $title, $type, $value, Text\_(), elseif, Factory\getApplication(), Joomla\Database\getDatabase(), ArrayHelper\getValue(), ParameterType\INTEGER, null, et Text\sprintf().

◆ 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, false, Joomla\Database\getDatabase(), et ParameterType\INTEGER.

◆ 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, $value, Text\_(), Factory\getApplication(), Joomla\Database\getDatabase(), ParameterType\INTEGER, Text\sprintf(), et ArrayHelper\toInteger().

◆ 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

Références Factory\getUser().

◆ 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, et Factory\getUser().

◆ cleanCache()

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

Custom clean the cache of com_content and content modules

Paramètres
string$groupCache group name.
integer$clientId

Références $extension, et Factory\getApplication().

◆ 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, et StringHelper\increment().

◆ 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, Joomla\CMS\MVC\Model\getState(), Associations\isEnabled(), 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
Form|boolean A JForm object on success, false on failure
Depuis
1.6

Implémente FormModelInterface.

Références $data, $extension, $form, $parts, Factory\getApplication(), Joomla\CMS\MVC\Model\getState(), Factory\getUser(), Joomla\CMS\MVC\Model\loadForm(), et Joomla\CMS\MVC\Model\setState().

◆ 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, $result, CategoriesHelper\getAssociations(), Joomla\CMS\MVC\Model\getState(), null, et ArrayHelper\toInteger().

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

Références $db, et Joomla\Database\getDatabase().

◆ getTable()

getTable (   $type = 'Category',
  $prefix = 'Administrator',
  $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
A Table 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, Factory\getApplication(), null, et Joomla\CMS\MVC\Model\preprocessData().

◆ 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, Factory\getApplication(), ComponentHelper\getParams(), null, et Joomla\CMS\MVC\Model\setState().

◆ preprocessForm()

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

Method to preprocess the form.

Paramètres
Form$formA Form object.
mixed$dataThe data expected for the form.
string$groupThe name of the plugin group to import.
Renvoie
mixed
Depuis
1.6
Exceptions

Références $component, $data, $extension, $field, $fields, $form, $lang, $language, $languages, $name, $path, $section, Text\_(), Path\clean(), Factory\getApplication(), Factory\getLanguage(), Joomla\CMS\MVC\Model\getState(), JPATH_ADMINISTRATOR, JPATH_BASE, Form\loadFile(), null, Joomla\CMS\MVC\Model\preprocessForm(), 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 $extension, $value, Factory\getApplication(), et PluginHelper\importPlugin().

◆ rebuild()

rebuild ( )

Method rebuild the entire nested set tree.

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

◆ save()

◆ 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
Form$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 Factory\getUser().

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 :