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 AdminModel
+ Graphe d'héritage de AdminModel:

Fonctions membres publiques

 __construct ($config=array(), MVCFactoryInterface $factory=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)
 
 createTagsHelper ($tagsObserver, $type, $pk, $typeAlias, $table)
 
 generateTitle ($categoryId, $table)
 
 initBatch ()
 
 editAssociations ($data)
 
- Fonctions membres publiques hérités de FormModel
 __construct ($config=array(), MVCFactoryInterface $factory=null)
 
 checkin ($pk=null)
 
 checkout ($pk=null)
 
 getForm ($data=array(), $loadData=true)
 
 validate ($form, $data, $group=null)
 
- Fonctions membres publiques hérités de BaseDatabaseModel
 __construct ($config=array(), MVCFactoryInterface $factory=null)
 
 getDbo ()
 
 getName ()
 
 getState ($property=null, $default=null)
 
 getTable ($name='', $prefix='Table', $options=array())
 
 loadHistory ($versionId, \JTable &$table)
 
 setDbo ($db)
 
 setState ($property, $value=null)
 

Champs de données

 $typeAlias
 

Fonctions membres protégées

 batchAccess ($value, $pks, $contexts)
 
 batchCopy ($value, $pks, $contexts)
 
 cleanupPostBatchCopy (\JTableInterface $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 FormModel
 loadForm ($name, $source=null, $options=array(), $clear=false, $xpath=false)
 
 loadFormData ()
 
 preprocessData ($context, &$data, $group='content')
 
 preprocessForm (\JForm $form, $data, $group='content')
 
- Fonctions membres protégées hérités de BaseDatabaseModel
 _getList ($query, $limitstart=0, $limit=0)
 
 _getListCount ($query)
 
 _createTable ($name, $prefix='Table', $config=array())
 
 populateState ()
 

Attributs protégés

 $text_prefix = null
 
 $event_after_delete = null
 
 $event_after_save = null
 
 $event_before_delete = null
 
 $event_before_save = null
 
 $event_change_state = null
 
 $batch_copymove = 'category_id'
 
 $batch_commands
 
 $associationsContext = null
 
 $batchSet = null
 
 $user = null
 
 $table = null
 
 $tableClassName = null
 
 $contentType = null
 
 $type = null
 
 $tagsObserver = null
 
- Attributs protégés hérités de FormModel
 $_forms = array()
 
 $events_map = null
 
- Attributs protégés hérités de BaseDatabaseModel
 $__state_set = null
 
 $_db
 
 $name
 
 $option = null
 
 $state
 
 $event_clean_cache = null
 
 $factory
 

Membres hérités additionnels

- Fonctions membres publiques statiques hérités de BaseDatabaseModel
static addIncludePath ($path='', $prefix='')
 
static addTablePath ($path)
 
static getInstance ($type, $prefix='', $config=array())
 
- Fonctions membres protégées statiques hérités de BaseDatabaseModel
static _createFileName ($type, $parts=array())
 

Description détaillée

Prototype admin model.

Depuis
1.6

Documentation des constructeurs et destructeur

◆ __construct()

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

Constructor.

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

Références $config, elseif, et option.

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 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.

◆ 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, $value, et elseif.

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

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

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

◆ 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 option.

◆ 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 option.

◆ 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, et $user.

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

◆ 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

◆ cleanupPostBatchCopy()

cleanupPostBatchCopy ( \JTableInterface  $table,
  $newId,
  $oldId 
)
protected

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

Paramètres
\JTableInterface$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

◆ createTagsHelper()

createTagsHelper (   $tagsObserver,
  $type,
  $pk,
  $typeAlias,
  $table 
)

Method to create a tags helper to ensure proper management of tags

Paramètres
\JTableObserverTags$tagsObserverThe tags observer for this table
\JUcmType$typeThe type for the table being processed
integer$pkPrimary key of the item bing processed
string$typeAliasThe type alias for this table
\JTable$tableThe object
Renvoie
void
Depuis
3.2

Références $type.

◆ 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, $dispatcher, $i, $name, $query, $row, JEventDispatcher\getInstance(), et option.

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

◆ 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
\JTable$tableThe 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
|boolean Object on success, false on failure.
Depuis
1.6

Références $item, $return, et ArrayHelper\toObject().

◆ getReorderConditions()

getReorderConditions (   $table)
protected

A protected method to get a set of ordering conditions.

Paramètres
\JTable$tableA 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 null.

◆ populateState()

populateState ( )
protected

Stock method to auto-populate the model state.

Renvoie
void
Depuis
1.6

Références $key, $value, et option.

◆ prepareTable()

prepareTable (   $table)
protected

Prepare and sanitise the table data prior to saving.

Paramètres
\JTable$tableA reference to a 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, $dispatcher, $i, $name, $user, $value, JEventDispatcher\getInstance(), et option.

◆ 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

Références $aliasArray, $app, $client, $component, $data, $extension, $id, $language, $target, $view, Factory\getApplication(), et LanguageHelper\getContentLanguages().

◆ 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, et null.

◆ save()

save (   $data)

Method to save the form data.

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

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

◆ 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, or if no items are selected
Depuis
1.6

Références $condition, $i, $key, et elseif.

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_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

◆ $tagsObserver

$tagsObserver = 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 :