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

Fonctions membres publiques

 getForm ($data=array(), $loadData=true)
 
 getHelp ()
 
 getItem ($pk=null)
 
 getModules ()
 
 getViewLevels ()
 
 getTable ($type='Menu', $prefix='Administrator', $config=array())
 
 rebuild ()
 
 save ($data)
 
 saveorder ($idArray=null, $lftArray=null)
 
 setHome (&$pks, $value=1)
 
 publish (&$pks, $value=1)
 
- 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 = 'com_menus.item'
 
- Champs de données hérités de AdminModel
 $typeAlias
 

Fonctions membres protégées

 canDelete ($record)
 
 canEditState ($record)
 
 batchCopy ($value, $pks, $contexts)
 
 batchMove ($value, $pks, $contexts)
 
 canSave ($data=array(), $key='id')
 
 loadFormData ()
 
 getReorderConditions ($table)
 
 populateState ()
 
 getMenuType ($menutype)
 
 getMenuTypeId ($menutype)
 
 preprocessForm (Form $form, $data, $group='content')
 
 generateNewTitle ($parentId, $alias, $title)
 
 cleanCache ($group=null, $clientId=0)
 
- 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

 $associationsContext = 'com_menus.item'
 
 $text_prefix = 'COM_MENUS_ITEM'
 
 $helpKey = 'Menu_Item:_New_Item'
 
 $helpURL
 
 $helpLocal = false
 
 $batch_copymove = 'menu_id'
 
 $batch_commands
 
- 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()
 

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

Menu Item Model for Menus.

Depuis
1.6

Documentation des fonctions membres

◆ batchCopy()

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

Batch copy menu items to a new menu or parent.

Paramètres
integer$valueThe new menu or sub-item.
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 $count, $db, $menuType, $parts, $query, $title, $user, $value, Text\_(), Joomla\Database\getDatabase(), Factory\getUser(), ArrayHelper\getValue(), ParameterType\INTEGER, null, et Text\sprintf().

◆ batchMove()

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

Batch move menu items to a new menu or parent.

Paramètres
integer$valueThe new menu or sub-item.
array$pksAn array of row IDs.
array$contextsAn array of item contexts.
Renvoie
boolean True on success.
Depuis
1.6

Références $db, $menuType, $parts, $query, $user, $value, Text\_(), Joomla\Database\getDatabase(), Factory\getUser(), ArrayHelper\getValue(), 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 the state of a record can be edited.

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
3.6

Références Factory\getUser().

◆ canSave()

canSave (   $data = array(),
  $key = 'id' 
)
protected

Method to check if you can save a record.

Paramètres
array$dataAn array of input data.
string$keyThe name of the key for the primary key.
Renvoie
boolean
Depuis
1.6

Références Factory\getUser().

◆ cleanCache()

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

Custom clean the cache

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

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

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

◆ 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
mixed A Form object on success, false on failure
Depuis
1.6

Implémente FormModelInterface.

Références $clientId, $data, $form, $item, Joomla\CMS\MVC\Model\getState(), ArrayHelper\getValue(), Joomla\CMS\MVC\Model\loadForm(), Joomla\CMS\MVC\Model\loadFormData(), et Joomla\CMS\MVC\Model\setState().

◆ getHelp()

getHelp ( )

Get the necessary data to load an item help screen.

Renvoie
object An object with key, url, and local properties for loading the item help screen.
Depuis
1.6

◆ getItem()

getItem (   $pk = null)

Method to get a menu item.

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

Références $component, $lang, $link, $result, $this, $type, MenusHelper\getAssociations(), ComponentHelper\getComponent(), Factory\getLanguage(), MenusHelper\getLinkKey(), Joomla\CMS\MVC\Model\getState(), Associations\isEnabled(), JPATH_ADMINISTRATOR, null, Joomla\CMS\MVC\Model\setState(), et ArrayHelper\toObject().

◆ getMenuType()

getMenuType (   $menutype)
protected

Loads the menutype object by a given menutype string

Paramètres
string$menutypeThe given menutype
Renvoie
Depuis
3.7.0

Références $menutype.

◆ getMenuTypeId()

getMenuTypeId (   $menutype)
protected

Loads the menutype ID by a given menutype string

Paramètres
string$menutypeThe given menutype
Renvoie
integer
Depuis
3.6

Références $menu, et $menutype.

◆ getModules()

getModules ( )

Get the list of modules not in trash.

Renvoie
mixed An array of module records (id, title, position), or false on error.
Depuis
1.6

Join on the module-to-menu mapping table. We are only interested if the module is displayed on ALL or THIS menu item (or the inverse ID number). sqlsrv changes for modulelink to menu manager

Références $clientId, $db, $id, $query, $result, Joomla\Database\getDatabase(), Joomla\CMS\MVC\Model\getState(), et ParameterType\INTEGER.

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

Paramètres
\Joomla\CMS\Table\Menu$table
Renvoie
array An array of conditions to add to add to ordering queries.
Depuis
1.6

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

◆ getTable()

getTable (   $type = 'Menu',
  $prefix = 'Administrator',
  $config = array() 
)

Returns a Table object, always creating it

Paramètres
string$typeThe table type to instantiate.
string$prefixA prefix for the table class name. Optional.
array$configConfiguration array for model. Optional.
Renvoie
| A database object.
Depuis
1.6

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

◆ getViewLevels()

getViewLevels ( )

Get the list of all view levels

Renvoie
[]|boolean An array of all view levels (id, title).
Depuis
3.4

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

◆ 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 $data, $filters, Factory\getApplication(), Joomla\CMS\MVC\Model\getState(), null, Joomla\CMS\MVC\Model\preprocessData(), et Joomla\CMS\MVC\Model\setState().

◆ populateState()

populateState ( )
protected

Auto-populate the model state.

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

Renvoie
void
Depuis
1.6

Note: a new menu item will have no field type. The field is required so the user has to change it.

Références $app, $clientId, $link, $menuType, $params, $type, 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
void
Depuis
1.6
Exceptions

Références $base, $clientId, $data, $field, $fields, $form, $helpURL, $language, $languages, $layout, $link, $option, $path, $templatePath, $type, $view, $xml, Text\_(), Path\clean(), elseif, Path\find(), ApplicationHelper\getClientInfo(), Joomla\CMS\MVC\Model\getState(), Associations\isEnabled(), JPATH_ADMINISTRATOR, null, et Joomla\CMS\MVC\Model\preprocessForm().

◆ 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

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

◆ rebuild()

rebuild ( )

Method rebuild the entire nested set tree.

Renvoie
boolean Boolean true on success, boolean false
Depuis
1.6

Références $db, $id, $item, $items, $params, $query, Factory\getApplication(), Joomla\Database\getDatabase(), et ParameterType\INTEGER.

◆ 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$idArrayRows identifiers to be reordered
array$lftArraylft values of rows to be reordered
Renvoie
boolean false on failure or error, true otherwise.
Depuis
1.6

◆ setHome()

setHome ( $pks,
  $value = 1 
)

Method to change the home state of one or more items.

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

Références $i, $languages, $value, Text\_(), elseif, Factory\getApplication(), et Text\sprintf().

Documentation des champs

◆ $associationsContext

$associationsContext = 'com_menus.item'
protected

◆ $batch_commands

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

◆ $batch_copymove

$batch_copymove = 'menu_id'
protected

◆ $helpKey

$helpKey = 'Menu_Item:_New_Item'
protected

◆ $helpLocal

$helpLocal = false
protected

◆ $helpURL

$helpURL
protected

◆ $text_prefix

$text_prefix = 'COM_MENUS_ITEM'
protected

◆ $typeAlias

$typeAlias = 'com_menus.item'

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