Back to Joomla project (class list)

Class ListModel - list of methods

Model class for handling lists of items.

Extends

Extends

Package: Joomla\CMS\MVC\Model
Copyright: (C) 2009 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
Located at: Joomla/MVC/Model/ListModel.php
Project: Joomla

Method Summary

public
(mixed $config = array(), \Joomla\CMS\MVC\Factory\MVCFactoryInterface $factory = null)

Constructor
Parameters
  • array $config An array of configuration options (name, state, dbo, table_path, ignore_request).
  • \Joomla\CMS\MVC\Factory\MVCFactoryInterface $factory The factory.
Since
  • 1.6
-
  • \Exception
Show source code of this method: __construct Source Code

protected \Joomla\Database\DatabaseQuery
()

Provide a query to be used to evaluate if this is an Empty State, can be overridden in the model to provide granular control.
Returns
  • \Joomla\Database\DatabaseQuery
Since
  • 4.0.0
Show source code of this method: getEmptyStateQuery Source Code

public bool
()

Is this an empty state, I.e: no items of this type regardless of the searched for states.
Returns
  • bool
Since
  • 4.0.0
-
  • \Exception
Show source code of this method: getIsEmptyState Source Code

protected \Joomla\Database\DatabaseQuery
()

Method to cache the last query constructed.
Returns
  • \Joomla\Database\DatabaseQuery A DatabaseQuery object
Since
  • 1.6
Show source code of this method: _getListQuery Source Code

public array
()

Function to get the active filters
Returns
  • array Associative array in the format: array('filter_published' => 0)
Since
  • 3.2
Show source code of this method: getActiveFilters Source Code

public mixed
()

Method to get an array of data items.
Returns
  • mixed An array of data items on success, false on failure.
Since
  • 1.6
Show source code of this method: getItems Source Code

protected \Joomla\Database\DatabaseQuery
()

Method to get a DatabaseQuery object for retrieving the data set from a database.
Returns
  • \Joomla\Database\DatabaseQuery A DatabaseQuery object to retrieve the data set.
Since
  • 1.6
Show source code of this method: getListQuery Source Code

public \Joomla\CMS\Pagination\Pagination
()

Method to get a \JPagination object for the data set.
Returns
  • \Joomla\CMS\Pagination\Pagination A Pagination object for the data set.
Since
  • 1.6
Show source code of this method: getPagination Source Code

protected string
(mixed $id = '')

Method to get a store id based on the model configuration state.
Parameters
  • string $id An identifier string to generate the store id.
Returns
  • string A store id.
Since
  • 1.6
Show source code of this method: getStoreId Source Code

public int
()

Method to get the total number of items for the data set.
Returns
  • int The total number of items available in the data set.
Since
  • 1.6
Show source code of this method: getTotal Source Code

public int
()

Method to get the starting number of items for the data set.
Returns
  • int The starting number of items available in the data set.
Since
  • 1.6
Show source code of this method: getStart Source Code

public \Joomla\CMS\Form\Form|null
(mixed $data = array(), mixed $loadData = true)

Get the filter form
Parameters
  • array $data data
  • bool $loadData load current data
Returns
  • \Joomla\CMS\Form\Form|null The \JForm object or null if the form can't be found
Since
  • 3.2
Show source code of this method: getFilterForm Source Code

protected mixed
()

Method to get the data that should be injected in the form.
Returns
  • mixed The data for the form.
Since
  • 3.2
Show source code of this method: loadFormData Source Code

protected void
(mixed $ordering = null, mixed $direction = null)

Method to auto-populate the model state.
Parameters
  • string $ordering An optional ordering field.
  • string $direction An optional direction (asc|desc).
Returns
  • void
Since
  • 1.6
Show source code of this method: populateState Source Code

public mixed
(mixed $key, mixed $request, mixed $default = null, mixed $type = 'none', mixed $resetPage = true)

Gets the value of a user state variable and sets it in the session
Parameters
  • 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 {@link InputFilter::clean()}. Optional.
  • bool $resetPage If true, the limitstart in request is set to zero
Returns
  • mixed The request user state.
Since
  • 1.6
Show source code of this method: getUserStateFromRequest Source Code

protected string
(mixed $search, mixed $regexDelimiter = '/')

Parse and transform the search string into a string fit for regex-ing arbitrary strings against
Parameters
  • string $search The search string
  • string $regexDelimiter The regex delimiter to use for the quoting
Returns
  • string Search string escaped for regex
Since
  • 3.4
Show source code of this method: refineSearchStringToRegex Source Code

Properties Summary

protected array
$cache
Internal memory based cache array of data.
Since
  • 1.6
protected string
$context
Context string for the model type. This is used to handle uniqueness when dealing with the getStoreId() method and caching data structures.
Since
  • 1.6
protected array
$filter_fields
Valid filter fields or ordering.
Since
  • 1.6
protected \Joomla\Database\DatabaseQuery[]
$query
An internal cache for the last query used.
Since
  • 1.6
protected null|string
$lastQueryStoreId
The cache ID used when last populating $this->query
Since
  • 3.10.4
protected string
$filterFormName
Name of the filter form to load
Since
  • 3.2
protected string
$htmlFormName
Associated HTML form
Since
  • 3.2
protected array
$filterBlacklist
A list of filter variables to not merge into the model's state
Since
  • 3.4.5
-
  • array
protected array
$filterForbiddenList
A list of forbidden filter variables to not merge into the model's state
Since
  • 4.0.0
protected array
$listBlacklist
A list of forbidden variables to not merge into the model's state
Since
  • 3.4.5
-
  • array
protected array
$listForbiddenList
A list of forbidden variables to not merge into the model's state
Since
  • 4.0.0

Tags Summary

Since
1.6