Class MenusModelItem

Description

Menu Item Model for Menus.

  • since: 1.6

Located in /administrator/components/com_menus/models/item.php (line 22)

JObject
   |
   --JModelLegacy
      |
      --JModelForm
         |
         --JModelAdmin
            |
            --MenusModelItem
Variable Summary
 string $helpKey
 boolean $helpLocal
 string $helpURL
 string $text_prefix
Method Summary
 boolean batch (array $commands, array $pks, array $contexts)
 mixed batchCopy (integer $value, array $pks, array $contexts)
 boolean batchMove (integer $value, array $pks, array $contexts)
 boolean canDelete (object A $record)
 boolean canEditState (object A $record)
 boolean canSave ([array $data = array()], [string $key = 'id'])
 void cleanCache ([ $group = null], [ $client_id = 0])
 array generateNewTitle (integer $parent_id, string $alias, string $title)
 mixed getForm ([array $data = array()], [boolean $loadData = true])
 object An getHelp ()
 mixed getItem ([integer $pk = null])
 mixed getModules ()
 JTable getTable ([type $type = 'Menu'], [string $prefix = 'MenusTable'], [array $config = array()])
 mixed loadFormData ()
 void populateState ()
 void preprocessForm (JForm $form, mixed $data, [ $group = 'content'])
 boolean publish (array &$pks, [integer $value = 1])
 boolean rebuild ()
 boolean save (array $data)
 boolean saveorder ([array $idArray = null], [array $lft_array = null])
 boolean setHome ( &$pks, [integer $value = 1], array $pks)
Variables
string $helpKey = 'JHELP_MENUS_MENU_ITEM_MANAGER_EDIT' (line 34)
  • var: The help screen key for the menu item.
  • since: 1.6
  • access: protected
boolean $helpLocal = false (line 46)
  • var: True to use local lookup for the help screen.
  • since: 1.6
  • access: protected
string $helpURL (line 40)
  • var: The help screen base URL for the menu item.
  • since: 1.6
  • access: protected
string $text_prefix = 'COM_MENUS_ITEM' (line 28)
  • var: The prefix to use with controller messages.
  • since: 1.6
  • access: protected

Redefinition of:
JModelAdmin::$text_prefix
The prefix to use with controller messages.

Inherited Variables

Inherited from JModelAdmin

JModelAdmin::$event_after_delete
JModelAdmin::$event_after_save
JModelAdmin::$event_before_delete
JModelAdmin::$event_before_save
JModelAdmin::$event_change_state

Inherited from JModelForm

JModelForm::$_forms

Inherited from JModelLegacy

JModelLegacy::$event_clean_cache
JModelLegacy::$name
JModelLegacy::$option
JModelLegacy::$state
JModelLegacy::$_db
JModelLegacy::$__state_set

Inherited from JObject

JObject::$_errors
Methods
batch (line 104)

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

  • return: Returns true on success, false on failure.
  • since: 1.6
  • access: public
boolean batch (array $commands, array $pks, array $contexts)
  • array $commands: An array of commands to perform.
  • array $pks: An array of item ids.
  • array $contexts: An array of item contexts.

Redefinition of:
JModelAdmin::batch()
Method to perform batch operations on an item or a set of items.
batchCopy (line 187)

Batch copy menu items to a new menu or parent.

  • return: An array of new IDs on success, boolean false on failure.
  • since: 1.6
  • access: protected
mixed batchCopy (integer $value, array $pks, array $contexts)
  • integer $value: The new menu or sub-item.
  • array $pks: An array of row IDs.
  • array $contexts: An array of item contexts.

Redefinition of:
JModelAdmin::batchCopy()
Batch copy items to a new category or current.
batchMove (line 381)

Batch move menu items to a new menu or parent.

  • return: True on success.
  • since: 1.6
  • access: protected
boolean batchMove (integer $value, array $pks, array $contexts)
  • integer $value: The new menu or sub-item.
  • array $pks: An array of row IDs.
  • array $contexts: An array of item contexts.
canDelete (line 56)

Method to test whether a record can be deleted.

  • return: True if allowed to delete the record. Defaults to the permission set in the component.
  • since: 1.6
  • access: protected
boolean canDelete (object A $record)
  • object A $record: record object.
canEditState (line 78)

Method to test whether a record can have its state edited.

  • return: True if allowed to change the state of the record. Defaults to the permission set in the component.
  • since: 1.6
  • access: protected
boolean canEditState (object A $record)
  • object A $record: record object.
canSave (line 530)

Method to check if you can save a record.

  • since: 1.6
  • access: protected
boolean canSave ([array $data = array()], [string $key = 'id'])
  • array $data: An array of input data.
  • string $key: The name of the key for the primary key.
cleanCache (line 1519)

Custom clean cache method

  • since: 1.6
  • access: protected
void cleanCache ([ $group = null], [ $client_id = 0])
  • $group
  • $client_id

Redefinition of:
JModelLegacy::cleanCache()
Clean the cache
generateNewTitle (line 1498)

Method to change the title & alias.

  • return: Contains the modified title and alias.
  • since: 1.6
  • access: protected
array generateNewTitle (integer $parent_id, string $alias, string $title)
  • integer $parent_id: The id of the parent.
  • string $alias: The alias.
  • string $title: The title.
getForm (line 543)

Method to get the row form.

  • return: A JForm object on success, false on failure
  • since: 1.6
  • access: public
mixed getForm ([array $data = array()], [boolean $loadData = true])
  • array $data: Data for the form.
  • boolean $loadData: True if the form is to load its own data (default case), false if not.

Redefinition of:
JModelForm::getForm()
Abstract method for getting the form from the model.
getHelp (line 604)

Get the necessary data to load an item help screen.

  • return: object with key, url, and local properties for loading the item help screen.
  • since: 1.6
  • access: public
object An getHelp ()
getItem (line 617)

Method to get a menu item.

  • return: Menu item data object on success, false on failure.
  • since: 1.6
  • access: public
mixed getItem ([integer $pk = null])
  • integer $pk: An optional id of the object to get, otherwise the id from the model state is used.
getModules (line 767)

Get the list of modules not in trash.

  • return: An array of module records (id, title, position), or false on error.
  • since: 1.6
  • access: public
mixed getModules ()
getReorderConditions (line 811)

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

  • return: An array of conditions to add to add to ordering queries.
  • since: 1.6
  • access: protected
array getReorderConditions (JTableMenu $table)
getTable (line 826)

Returns a Table object, always creating it

  • return: A database object
  • since: 1.6
  • access: public
JTable getTable ([type $type = 'Menu'], [string $prefix = 'MenusTable'], [array $config = array()])
  • type $type: The table type to instantiate
  • string $prefix: A prefix for the table class name. Optional.
  • array $config: Configuration array for model. Optional.

Redefinition of:
JModelLegacy::getTable()
Method to get a table object, load it if necessary.
loadFormData (line 588)

Method to get the data that should be injected in the form.

  • return: The data for the form.
  • since: 1.6
  • access: protected
mixed loadFormData ()

Redefinition of:
JModelForm::loadFormData()
Method to get the data that should be injected in the form.
populateState (line 839)

Auto-populate the model state.

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

  • since: 1.6
  • access: protected
void populateState ()

Redefinition of:
JModelLegacy::populateState()
Method to auto-populate the model state.
preprocessForm (line 886)
  • since: 1.6
  • throws: Exception if there is an error in the form event.
  • access: protected
void preprocessForm (JForm $form, mixed $data, [ $group = 'content'])
  • object $form: A form object.
  • mixed $data: The data expected for the form.
  • $group

Redefinition of:
JModelForm::preprocessForm()
Method to allow derived classes to preprocess the form.
publish (line 1455)

Method to change the published state of one or more records.

  • return: True on success.
  • since: 1.6
  • access: public
boolean publish (array &$pks, [integer $value = 1])
  • array &$pks: A list of the primary keys to change.
  • integer $value: The value of the published state.
rebuild (line 1100)

Method rebuild the entire nested set tree.

  • return: False on failure or error, true otherwise.
  • since: 1.6
  • access: public
boolean rebuild ()
save (line 1165)

Method to save the form data.

  • return: True on success.
  • since: 1.6
  • access: public
boolean save (array $data)
  • array $data: The form data.
saveorder (line 1350)

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.

  • return: false on failuer or error, true otherwise
  • since: 1.6
  • access: public
boolean saveorder ([array $idArray = null], [array $lft_array = null])
  • array $idArray: id's of rows to be reordered
  • array $lft_array: lft values of rows to be reordered
setHome (line 1376)

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

  • return: True on success.
  • since: 1.6
  • access: public
boolean setHome ( &$pks, [integer $value = 1], array $pks)
  • array $pks: A list of the primary keys to change.
  • integer $value: The value of the home state.
  • &$pks

Inherited Methods

Inherited From JModelAdmin

 JModelAdmin::__construct()
 JModelAdmin::batch()
 JModelAdmin::batchAccess()
 JModelAdmin::batchCopy()

Inherited From JModelForm

 JModelForm::checkin()
 JModelForm::checkout()
 JModelForm::getForm()
 JModelForm::loadForm()
 JModelForm::loadFormData()
 JModelForm::preprocessData()
 JModelForm::preprocessForm()
 JModelForm::validate()

Inherited From JModelLegacy

 JModelLegacy::__construct()
 JModelLegacy::addIncludePath()
 JModelLegacy::addTablePath()
 JModelLegacy::cleanCache()
 JModelLegacy::getDbo()
 JModelLegacy::getInstance()
 JModelLegacy::getName()
 JModelLegacy::getState()
 JModelLegacy::getTable()
 JModelLegacy::loadHistory()
 JModelLegacy::populateState()
 JModelLegacy::setDbo()
 JModelLegacy::setState()
 JModelLegacy::_createFileName()
 JModelLegacy::_createTable()
 JModelLegacy::_getList()
 JModelLegacy::_getListCount()

Inherited From JObject

 JObject::__construct()
 JObject::def()
 JObject::get()
 JObject::getError()
 JObject::getErrors()
 JObject::getProperties()
 JObject::set()
 JObject::setError()
 JObject::setProperties()
 JObject::__toString()

Documentation generated on Tue, 19 Nov 2013 15:05:57 +0100 by phpDocumentor 1.4.3