[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_menus/src/Model/ -> ItemModel.php (summary)

(no description)

Copyright: (C) 2006 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
File Size: 1759 lines (59 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

ItemModel:: (24 methods):
  canDelete()
  canEditState()
  batchCopy()
  batchMove()
  canSave()
  getForm()
  loadFormData()
  getHelp()
  getItem()
  getModules()
  getViewLevels()
  getTable()
  getReorderConditions()
  populateState()
  getMenuType()
  getMenuTypeId()
  preprocessForm()
  rebuild()
  save()
  saveorder()
  setHome()
  publish()
  generateNewTitle()
  cleanCache()


Class: ItemModel  - X-Ref

Menu Item Model for Menus.

canDelete($record)   X-Ref
Method to test whether a record can be deleted.

param: object  $record  A record object.
return: boolean  True if allowed to delete the record. Defaults to the permission set in the component.

canEditState($record)   X-Ref
Method to test whether the state of a record can be edited.

param: object  $record  A record object.
return: boolean  True if allowed to change the state of the record. Defaults to the permission for the component.

batchCopy($value, $pks, $contexts)   X-Ref
Batch copy menu items to a new menu or parent.

param: integer  $value     The new menu or sub-item.
param: array    $pks       An array of row IDs.
param: array    $contexts  An array of item contexts.
return: mixed  An array of new IDs on success, boolean false on failure.

batchMove($value, $pks, $contexts)   X-Ref
Batch move menu items to a new menu or parent.

param: integer  $value     The new menu or sub-item.
param: array    $pks       An array of row IDs.
param: array    $contexts  An array of item contexts.
return: boolean  True on success.

canSave($data = array()   X-Ref
Method to check if you can save a record.

param: array   $data  An array of input data.
param: string  $key   The name of the key for the primary key.
return: boolean

getForm($data = array()   X-Ref
Method to get the row form.

param: array    $data      Data for the form.
param: boolean  $loadData  True if the form is to load its own data (default case), false if not.
return: mixed  A Form object on success, false on failure

loadFormData()   X-Ref
Method to get the data that should be injected in the form.

return: mixed  The data for the form.

getHelp()   X-Ref
Get the necessary data to load an item help screen.

return: object  An object with key, url, and local properties for loading the item help screen.

getItem($pk = null)   X-Ref
Method to get a menu item.

param: integer  $pk  An optional id of the object to get, otherwise the id from the model state is used.
return: mixed  Menu item data object on success, false on failure.

getModules()   X-Ref
Get the list of modules not in trash.

return: mixed  An array of module records (id, title, position), or false on error.

getViewLevels()   X-Ref
Get the list of all view levels

return: \stdClass[]|boolean  An array of all view levels (id, title).

getTable($type = 'Menu', $prefix = 'Administrator', $config = array()   X-Ref
Returns a Table object, always creating it

param: string  $type    The table type to instantiate.
param: string  $prefix  A prefix for the table class name. Optional.
param: array   $config  Configuration array for model. Optional.
return: \Joomla\Cms\Table\Table|\Joomla\Cms\Table\Nested  A database object.

getReorderConditions($table)   X-Ref
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: \Joomla\CMS\Table\Menu  $table
return: array  An array of conditions to add to add to ordering queries.

populateState()   X-Ref
Auto-populate the model state.

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

return: void

getMenuType($menutype)   X-Ref
Loads the menutype object by a given menutype string

param: string  $menutype  The given menutype
return: \stdClass

getMenuTypeId($menutype)   X-Ref
Loads the menutype ID by a given menutype string

param: string  $menutype  The given menutype
return: integer

preprocessForm(Form $form, $data, $group = 'content')   X-Ref
Method to preprocess the form.

param: Form    $form   A Form object.
param: mixed   $data   The data expected for the form.
param: string  $group  The name of the plugin group to import.
return: void

rebuild()   X-Ref
Method rebuild the entire nested set tree.

return: boolean  Boolean true on success, boolean false

save($data)   X-Ref
Method to save the form data.

param: array  $data  The form data.
return: boolean  True on success.

saveorder($idArray = null, $lftArray = null)   X-Ref
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: array  $idArray   Rows identifiers to be reordered
param: array  $lftArray  lft values of rows to be reordered
return: boolean false on failure or error, true otherwise.

setHome(&$pks, $value = 1)   X-Ref
Method to change the home state of one or more items.

param: array    $pks    A list of the primary keys to change.
param: integer  $value  The value of the home state.
return: boolean  True on success.

publish(&$pks, $value = 1)   X-Ref
Method to change the published state of one or more records.

param: array    $pks    A list of the primary keys to change.
param: integer  $value  The value of the published state.
return: boolean  True on success.

generateNewTitle($parentId, $alias, $title)   X-Ref
Method to change the title & alias.

param: integer  $parentId  The id of the parent.
param: string   $alias     The alias.
param: string   $title     The title.
return: array  Contains the modified title and alias.

cleanCache($group = null, $clientId = 0)   X-Ref
Custom clean the cache

param: string   $group     Cache group name.
param: integer  $clientId  @deprecated  5.0  No Longer Used.
return: void



Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer