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

Fonctions membres publiques

 __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)
 
- Fonctions membres publiques hérités de FormModelInterface
 getForm ($data=array(), $loadData=true)
 

Champs de données

 $typeAlias
 

Fonctions membres protégées

 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 = 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()
 

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

Prototype admin model.

Depuis
1.6

Documentation des constructeurs et destructeur

◆ __construct()

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

Constructor.

Paramètres
array$configAn array of configuration options (name, state, dbo, table_path, ignore_request).
MVCFactoryInterface$factoryThe factory.
FormFactoryInterface$formFactoryThe form factory.
Depuis
1.6
Exceptions

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

Documentation des fonctions membres

◆ batch()

batch (   $commands,
  $pks,
  $contexts 
)

Method to perform batch operations on an item or a set of items.

Paramètres
array$commandsAn array of commands to perform.
array$pksAn array of item ids.
array$contextsAn array of item contexts.
Renvoie
boolean Returns true on success, false on failure.
Depuis
1.7

Références $result, Text\_(), elseif, ArrayHelper\getValue(), et ArrayHelper\toInteger().

◆ batchAccess()

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

Batch access level changes for a group of rows.

Paramètres
integer$valueThe new value matching an Asset Group ID.
array$pksAn array of row IDs.
array$contextsAn array of item contexts.
Renvoie
boolean True if successful, false otherwise and internal error is set.
Depuis
1.7

Références $value, et Text\_().

◆ batchCopy()

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

Batch copy items to a new category or current.

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

Références $db, $query, $this, $value, elseif, Joomla\CMS\MVC\Model\getDbo(), ParameterType\INTEGER, et Text\sprintf().

◆ batchLanguage()

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

Batch language changes for a group of rows.

Paramètres
string$valueThe new value matching a language.
array$pksAn array of row IDs.
array$contextsAn array of item contexts.
Renvoie
boolean True if successful, false otherwise and internal error is set.
Depuis
2.5

Références $value, et Text\_().

◆ batchMove()

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

Batch move items 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 if successful, false otherwise and internal error is set.
Depuis
1.7

Références $value, Text\_(), et Text\sprintf().

◆ batchTag()

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

Batch tag a list of item.

Paramètres
integer$valueThe value of the new tag.
array$pksAn array of row IDs.
array$contextsAn array of item contexts.
Renvoie
boolean True if successful, false otherwise and internal error is set.
Depuis
3.1

Références $value, Text\_(), et AbstractEvent\create().

◆ 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 for 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 for the component.
Depuis
1.6

Références Factory\getUser().

◆ checkCategoryId()

checkCategoryId (   $categoryId)
protected

Method to check the validity of the category ID for batch copy and move

Paramètres
integer$categoryIdThe category ID to check
Renvoie
boolean
Depuis
3.2

Références $extension, $user, Text\_(), Factory\getApplication(), Table\getInstance(), et Factory\getUser().

◆ checkin()

checkin (   $pks = array())

Method override to check-in a record or an array of record

Paramètres
mixed$pksThe ID of the primary key or an array of IDs
Renvoie
integer|boolean Boolean false if there is an error, otherwise the count of records checked in.
Depuis
1.6

Références $count, et Joomla\CMS\MVC\Model\getState().

◆ checkout()

checkout (   $pk = null)

Method override to check-out a record.

Paramètres
integer$pkThe ID of the primary key.
Renvoie
boolean True if successful, false if an error occurs.
Depuis
1.6

Références Joomla\CMS\MVC\Model\getState().

◆ cleanupPostBatchCopy()

cleanupPostBatchCopy ( TableInterface  $table,
  $newId,
  $oldId 
)
protected

Function that can be overridden to do any data cleanup after batch copying data

Paramètres
TableInterface$tableThe table object containing the newly created item
integer$newIdThe id of the new item
integer$oldIdThe original item id
Renvoie
void
Depuis
3.8.12

◆ delete()

delete ( $pks)

Method to delete one or more records.

Paramètres
array&$pksAn array of record primary keys.
Renvoie
boolean True if successful, false if an error occurs.
Depuis
1.6

Références $context, $db, $i, $name, $query, $result, Text\_(), Log\add(), Factory\getApplication(), Joomla\CMS\MVC\Model\getDbo(), PluginHelper\importPlugin(), ParameterType\INTEGER, Associations\isEnabled(), ArrayHelper\toInteger(), et Log\WARNING.

◆ editAssociations()

editAssociations (   $data)

Method to load an item in com_associations.

Paramètres
array$dataThe form data.
Renvoie
boolean True if successful, false otherwise.
Depuis
3.9.0
Obsolète:
5.0 It is handled by regular save method now.

Références $data.

◆ generateNewTitle()

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

Method to change the title & alias.

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

Références $title, et StringHelper\increment().

◆ generateTitle()

generateTitle (   $categoryId,
  $table 
)

A method to preprocess generating a new title in order to allow tables with alternative names for alias and title to use the batch move and copy methods

Paramètres
integer$categoryIdThe target category id
Table$tableThe Table within which move or copy is taking place
Renvoie
void
Depuis
3.2

Références $data.

◆ getItem()

getItem (   $pk = null)

Method to get a single record.

Paramètres
integer$pkThe id of the primary key.
Renvoie
CMSObject|boolean Object on success, false on failure.
Depuis
1.6

Références $item, $return, Text\_(), class, Joomla\CMS\MVC\Model\getState(), et ArrayHelper\toObject().

◆ getReorderConditions()

getReorderConditions (   $table)
protected

A protected method to get a set of ordering conditions.

Paramètres
Table$tableA Table object.
Renvoie
array An array of conditions to add to ordering queries.
Depuis
1.6

◆ initBatch()

initBatch ( )

Method to initialize member variables used by batch methods and other methods like saveorder()

Renvoie
void
Depuis
3.8.2

Références Factory\getUser(), et null.

◆ populateState()

populateState ( )
protected

Stock method to auto-populate the model state.

Renvoie
void
Depuis
1.6

Références $key, $value, Factory\getApplication(), ComponentHelper\getParams(), et Joomla\CMS\MVC\Model\setState().

◆ prepareTable()

prepareTable (   $table)
protected

Prepare and sanitise the table data prior to saving.

Paramètres
Table$tableA reference to a Table object.
Renvoie
void
Depuis
1.6

◆ 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
1.6

Prune items that are already at the given state. Note: Only models whose table correctly sets 'published' column alias (if different than published) will benefit from this

Références $context, $i, $name, $result, $user, $value, Text\_(), Log\add(), Factory\getApplication(), Factory\getUser(), PluginHelper\importPlugin(), et Log\WARNING.

◆ redirectToAssociations()

redirectToAssociations (   $data)
protected

Method to load an item in com_associations.

Paramètres
array$dataThe form data.
Renvoie
boolean True if successful, false otherwise.
Exceptions

If the site contains only 2 languages and an association exists for the item load directly the associated target item in the side by side view otherwise select already the target language

Références $app, $client, $component, $data, $extension, $id, $language, $languages, $target, $view, Text\_(), Route\_(), et Factory\getApplication().

◆ reorder()

reorder (   $pks,
  $delta = 0 
)

Method to adjust the ordering of a row.

Returns NULL if the user did not have edit privileges for any of the selected primary keys.

Paramètres
integer$pksThe ID of the primary key to move.
integer$deltaIncrement, usually +1 or -1
Renvoie
boolean|null False on failure or error, true on success, null if the $pk is empty (no items selected).
Depuis
1.6

Références $i, $result, Text\_(), Log\add(), null, et Log\WARNING.

◆ save()

save (   $data)

◆ saveorder()

saveorder (   $pks = array(),
  $order = null 
)

Saves the manually set order of records.

Paramètres
array$pksAn array of primary key ids.
integer$order+1 or -1
Renvoie
boolean Boolean true on success, false on failure
Depuis
1.6

Références $i, $key, Text\_(), Log\add(), elseif, Factory\getApplication(), et Log\WARNING.

Documentation des champs

◆ $associationsContext

$associationsContext = null
protected

◆ $batch_commands

$batch_commands
protected
Valeur initiale :
= array(
'assetgroup_id' => 'batchAccess',
'language_id' => 'batchLanguage',
'tag' => 'batchTag'
)

◆ $batch_copymove

$batch_copymove = 'category_id'
protected

◆ $batchSet

$batchSet = null
protected

◆ $contentType

$contentType = null
protected

◆ $event_after_delete

$event_after_delete = null
protected

◆ $event_after_save

$event_after_save = null
protected

◆ $event_before_batch

$event_before_batch = null
protected

◆ $event_before_change_state

$event_before_change_state = null
protected

◆ $event_before_delete

$event_before_delete = null
protected

◆ $event_before_save

$event_before_save = null
protected

◆ $event_change_state

$event_change_state = null
protected

◆ $table

$table = null
protected

◆ $tableClassName

$tableClassName = null
protected

◆ $text_prefix

$text_prefix = null
protected

◆ $type

$type = null
protected

◆ $typeAlias

$typeAlias

◆ $user

$user = null
protected

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