Class JModelList

Description

Model class for handling lists of items.

  • since: 12.2

Located in /libraries/legacy/model/list.php (line 19)

JObject
   |
   --JModelLegacy
      |
      --JModelList
Direct descendents
Class Description
 class BannersModelBanners Banners model for the Joomla Banners component.
 class BannersModelClients Methods supporting a list of banner records.
 class BannersModelTracks Methods supporting a list of tracks.
 class CacheModelCache Cache Model
 class CategoriesModelCategories Categories Component Categories Model
 class CheckinModelCheckin Checkin Model
 class ContactModelContacts Methods supporting a list of contact records.
 class ContentModelArticles This models supports retrieving lists of articles.
 class ContenthistoryModelHistory Methods supporting a list of contenthistory records.
 class FinderModelFilters Filters model class for Finder.
 class FinderModelIndex Index model class for Finder.
 class FinderModelMaps Maps model for the Finder package.
Abstract class InstallerModel Extension Manager Abstract Extension Model
 class InstallerModelLanguages Languages Installer Model
 class InstallerModelUpdate Installer Update Model
 class InstallerModelWarnings Extension Manager Templates Model
 class LanguagesModelInstalled Languages Component Languages Model
 class LanguagesModelLanguages Languages Model Class
 class LanguagesModelOverrides Languages Overrides Model
 class MenusModelItems Menu Item List Model for Menus.
 class MenusModelMenus Menu List Model for Menus.
 class MessagesModelMessages Messages Component Messages Model
 class ModulesModelModules Modules Component Module Model
 class ModulesModelPositions Modules Component Positions Model
 class ModulesModelSelect Module model.
 class NewsfeedsModelNewsfeeds Methods supporting a list of newsfeed records.
 class PluginsModelPlugins Methods supporting a list of plugin records.
 class RedirectModelLinks Methods supporting a list of redirect links.
 class SearchModelSearches Methods supporting a list of search terms.
 class TagsModelTags This models supports retrieving a list of tags.
 class TemplatesModelStyles Methods supporting a list of template style records.
 class TemplatesModelTemplates Methods supporting a list of template extension records.
 class UsersModelDebuggroup Methods supporting a list of user records.
 class UsersModelDebugUser Methods supporting a list of user records.
 class UsersModelGroups Methods supporting a list of user group records.
 class UsersModelLevels Methods supporting a list of user access level records.
 class UsersModelNotes User notes model class.
 class UsersModelUsers Methods supporting a list of user records.
 class WeblinksModelWeblinks Methods supporting a list of weblink records.
 class ContactModelCategories This models supports retrieving lists of contact categories.
 class ContactModelCategory
 class ContactModelFeatured
 class ContentModelCategories This models supports retrieving lists of article categories.
 class ContentModelCategory This models supports retrieving a category, the articles associated with the category, sibling, child and parent categories.
 class FinderModelSearch Search model class for the Finder package.
 class FinderModelSuggestions Suggestions model class for the Finder package.
 class NewsfeedsModelCategories This models supports retrieving lists of newsfeed categories.
 class NewsfeedsModelCategory Newsfeeds Component Category Model
 class TagsModelTag Tags Component Tag Model
 class WeblinksModelCategories This models supports retrieving lists of article categories.
 class WeblinksModelCategory Weblinks Component Weblink Model
Variable Summary
Method Summary
 JModelList __construct ([array $config = array()])
 array getActiveFilters ()
 JForm/false getFilterForm ([array $data = array()], [boolean $loadData = true])
 mixed getItems ()
 integer getStart ()
 string getStoreId ([string $id = ''])
 integer getTotal ()
 The getUserStateFromRequest (string $key, string $request, [string $default = null], [string $type = 'none'], [boolean $resetPage = true])
 mixed loadForm (string $name, [string $source = null], [array $options = array()], [boolean $clear = false], [string $xpath = false])
 mixed loadFormData ()
 void populateState ([string $ordering = null], [string $direction = null])
 void preprocessForm (JForm $form, mixed $data, [string $group = 'content'])
Variables
array $cache = array() (line 27)

Internal memory based cache array of data.

  • since: 12.2
  • access: protected
string $context = null (line 36)

Context string for the model type. This is used to handle uniqueness when dealing with the getStoreId() method and caching data structures.

  • since: 12.2
  • access: protected

Redefined in descendants as:
string $filterFormName = null (line 60)

Name of the filter form to load

  • since: 3.2
  • access: protected
array $filter_fields = array() (line 44)

Valid filter fields or ordering.

  • since: 12.2
  • access: protected
string $htmlFormName = 'adminForm' (line 67)

Associated HTML form

  • access: protected
JDatabaseQuery $query = array() (line 52)

An internal cache for the last query used.

  • since: 12.2
  • access: protected

Redefined in descendants as:
  • FinderModelSearch::$query : The query object is an instance of FinderIndexerQuery which contains and models the entire search query including the text input; static and dynamic taxonomy filters; date filters; etc.

Inherited Variables

Inherited from JModelLegacy

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

Inherited from JObject

JObject::$_errors
Methods
Constructor __construct (line 77)

Constructor.

JModelList __construct ([array $config = array()])
  • array $config: An optional associative array of configuration settings.

Redefinition of:
JModelLegacy::__construct()
Constructor

Redefined in descendants as:
getActiveFilters (line 128)

Function to get the active filters

  • return: Associative array in the format: array('filter_published' => 0)
  • since: 3.2
  • access: public
array getActiveFilters ()
getFilterForm (line 333)

Get the filter form

  • return: the JForm object or false
  • since: 3.2
  • access: public
JForm/false getFilterForm ([array $data = array()], [boolean $loadData = true])
  • array $data: data
  • boolean $loadData: load current data
getItems (line 155)

Method to get an array of data items.

  • return: An array of data items on success, false on failure.
  • since: 12.2
  • access: public
mixed getItems ()

Redefined in descendants as:
getListQuery (line 193)

Method to get a JDatabaseQuery object for retrieving the data set from a database.

  • return: A JDatabaseQuery object to retrieve the data set.
  • since: 12.2
  • access: protected
JDatabaseQuery getListQuery ()

Redefined in descendants as:
getPagination (line 208)

Method to get a JPagination object for the data set.

  • return: A JPagination object for the data set.
  • since: 12.2
  • access: public
JPagination getPagination ()

Redefined in descendants as:
getStart (line 298)

Method to get the starting number of items for the data set.

  • return: The starting number of items available in the data set.
  • since: 12.2
  • access: public
integer getStart ()

Redefined in descendants as:
getStoreId (line 242)

Method to get a store id based on the model configuration state.

This is necessary because the model is used by the component and different modules that might need different sets of data or different ordering requirements.

  • return: A store id.
  • since: 12.2
  • access: protected
string getStoreId ([string $id = ''])
  • string $id: An identifier string to generate the store id.

Redefined in descendants as:
getTotal (line 260)

Method to get the total number of items for the data set.

  • return: The total number of items available in the data set.
  • since: 12.2
  • access: public
integer getTotal ()

Redefined in descendants as:
getUserStateFromRequest (line 657)

Gets the value of a user state variable and sets it in the session

This is the same as the method in JApplication except that this also can optionally force you back to the first page when a filter has changed

  • return: request user state.
  • since: 12.2
  • access: public
The getUserStateFromRequest (string $key, string $request, [string $default = null], [string $type = 'none'], [boolean $resetPage = true])
  • string $key: The key of the user state variable.
  • string $request: The name of the variable passed in a request.
  • string $default: The default value for the variable if not found. Optional.
  • string $type: Filter for the variable, for valid values see JFilterInput::clean(). Optional.
  • boolean $resetPage: If true, the limitstart in request is set to zero
loadForm (line 371)

Method to get a form object.

  • return: JForm object on success, False on error.
  • see: JForm
  • since: 3.2
  • access: protected
mixed loadForm (string $name, [string $source = null], [array $options = array()], [boolean $clear = false], [string $xpath = false])
  • string $name: The name of the form.
  • string $source: The form source. Can be XML string if file flag is set to false.
  • array $options: Optional array of options for the form creation.
  • boolean $clear: Optional argument to force load a new form.
  • string $xpath: An optional xpath to search for the fields.
loadFormData (line 430)

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

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

Redefined in descendants as:
populateState (line 465)

Method to auto-populate the model state.

This method should only be called once per instantiation and is designed to be called on the first call to the getState() method unless the model configuration flag to ignore the request is set.

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

  • since: 12.2
  • access: protected
void populateState ([string $ordering = null], [string $direction = null])
  • string $ordering: An optional ordering field.
  • string $direction: An optional direction (asc|desc).

Redefinition of:
JModelLegacy::populateState()
Method to auto-populate the model state.

Redefined in descendants as:
preprocessForm (line 617)

Method to allow derived classes to preprocess the form.

  • since: 3.2
  • throws: Exception if there is an error in the form event.
  • access: protected
void preprocessForm (JForm $form, mixed $data, [string $group = 'content'])
  • JForm $form: A JForm object.
  • mixed $data: The data expected for the form.
  • string $group: The name of the plugin group to import (defaults to "content").
_getListQuery (line 103)

Method to cache the last query constructed.

This method ensures that the query is constructed only once for a given state of the model.

  • return: A JDatabaseQuery object
  • since: 12.2
  • access: protected
JDatabaseQuery _getListQuery ()

Redefined in descendants as:

Inherited Methods

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:07:17 +0100 by phpDocumentor 1.4.3