Class MenusModelItem

Description

Menu Item Model for Menus.

  • since: 1.6

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

JObject
   |
   --JModel
      |
      --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 ( &$pks, [int $value = 1], array $pks)
boolean rebuild ()
boolean save (array $data)
boolean saveorder ([array $idArray = null], [array $lft_array = null])
boolean setHome ( &$pks, [int $value = 1], array $pks)
Variables
string $helpKey = 'JHELP_MENUS_MENU_ITEM_MANAGER_EDIT' (line 39)
  • var: The help screen key for the menu item.
  • since: 1.6
  • access: protected
boolean $helpLocal = false (line 51)
  • var: True to use local lookup for the help screen.
  • since: 1.6
  • access: protected
string $helpURL (line 45)
  • var: The help screen base URL for the menu item.
  • since: 1.6
  • access: protected
string $text_prefix = 'COM_MENUS_ITEM' (line 33)
  • 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 JModel

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

Inherited from JObject

JObject::$_errors
Methods
batch (line 105)

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 188)

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 379)

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.

Redefinition of:
JModelAdmin::batchMove()
Batch move items to a new category
canDelete (line 61)

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.

Redefinition of:
JModelAdmin::canDelete()
Method to test whether a record can be deleted.
canEditState (line 81)

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.

Redefinition of:
JModelAdmin::canEditState()
Method to test whether a record can be deleted.
canSave (line 526)

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 1388)

Custom clean cache method

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

Redefinition of:
JModel::cleanCache()
Clean the cache
generateNewTitle (line 1370)

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.

Redefinition of:
JModelAdmin::generateNewTitle()
Method to change the title & alias.
getForm (line 539)

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 591)

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 604)

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.

Redefinition of:
JModelAdmin::getItem()
Method to get a single record.
getModules (line 741)

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 781)

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)

Redefinition of:
JModelAdmin::getReorderConditions()
A protected method to get a set of ordering conditions.
getTable (line 796)

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:
JModel::getTable()
Method to get a table object, load it if necessary.
loadFormData (line 579)

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 809)

Auto-populate the model state.

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

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

Redefinition of:
JModelAdmin::populateState()
Stock method to auto-populate the model state.
preprocessForm (line 852)
  • 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 1334)

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

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

Redefinition of:
JModelAdmin::publish()
Method to change the published state of one or more records.
rebuild (line 1020)

Method rebuild the entire nested set tree.

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

Method to save the form data.

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

Redefinition of:
JModelAdmin::save()
Method to save the form data.
saveorder (line 1239)

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

Redefinition of:
JModelAdmin::saveorder()
Saves the manually set order of records.
setHome (line 1264)

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

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

Inherited Methods

Inherited From JModelAdmin

JModelAdmin::__construct()
JModelAdmin::batch()
JModelAdmin::batchAccess()
JModelAdmin::batchCopy()
JModelAdmin::batchLanguage()
JModelAdmin::batchMove()
JModelAdmin::canDelete()
JModelAdmin::canEditState()
JModelAdmin::checkin()
JModelAdmin::checkout()
JModelAdmin::delete()
JModelAdmin::generateNewTitle()
JModelAdmin::getItem()
JModelAdmin::getReorderConditions()
JModelAdmin::populateState()
JModelAdmin::prepareTable()
JModelAdmin::publish()
JModelAdmin::reorder()
JModelAdmin::save()
JModelAdmin::saveorder()

Inherited From JModelForm

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

Inherited From JModel

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

Inherited From JObject

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

Documentation generated on Mon, 25 Jun 2012 13:55:56 -0500 by phpDocumentor 1.4.4