[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/src/MVC/Model/ -> ListModel.php (summary)

Joomla! Content Management System

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

Defines 1 class

ListModel:: (16 methods):
  __construct()
  getEmptyStateQuery()
  getIsEmptyState()
  _getListQuery()
  getActiveFilters()
  getItems()
  getListQuery()
  getPagination()
  getStoreId()
  getTotal()
  getStart()
  getFilterForm()
  loadFormData()
  populateState()
  getUserStateFromRequest()
  refineSearchStringToRegex()


Class: ListModel  - X-Ref

Model class for handling lists of items.

__construct($config = array()   X-Ref
Constructor

param: array                $config   An array of configuration options (name, state, dbo, table_path, ignore_request).
param: MVCFactoryInterface  $factory  The factory.

getEmptyStateQuery()   X-Ref
Provide a query to be used to evaluate if this is an Empty State, can be overridden in the model to provide granular control.

return: DatabaseQuery

getIsEmptyState()   X-Ref
Is this an empty state, I.e: no items of this type regardless of the searched for states.

return: boolean

_getListQuery()   X-Ref
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: DatabaseQuery  A DatabaseQuery object

getActiveFilters()   X-Ref
Function to get the active filters

return: array  Associative array in the format: array('filter_published' => 0)

getItems()   X-Ref
Method to get an array of data items.

return: mixed  An array of data items on success, false on failure.

getListQuery()   X-Ref
Method to get a DatabaseQuery object for retrieving the data set from a database.

return: DatabaseQuery  A DatabaseQuery object to retrieve the data set.

getPagination()   X-Ref
Method to get a \JPagination object for the data set.

return: Pagination  A Pagination object for the data set.

getStoreId($id = '')   X-Ref
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.

param: string  $id  An identifier string to generate the store id.
return: string  A store id.

getTotal()   X-Ref
Method to get the total number of items for the data set.

return: integer  The total number of items available in the data set.

getStart()   X-Ref
Method to get the starting number of items for the data set.

return: integer  The starting number of items available in the data set.

getFilterForm($data = array()   X-Ref
Get the filter form

param: array    $data      data
param: boolean  $loadData  load current data
return: Form|null  The \JForm object or null if the form can't be found

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

return: mixed   The data for the form.

populateState($ordering = null, $direction = null)   X-Ref
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.

param: string  $ordering   An optional ordering field.
param: string  $direction  An optional direction (asc|desc).
return: void

getUserStateFromRequest($key, $request, $default = null, $type = 'none', $resetPage = true)   X-Ref
Gets the value of a user state variable and sets it in the session

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

param: string   $key        The key of the user state variable.
param: string   $request    The name of the variable passed in a request.
param: string   $default    The default value for the variable if not found. Optional.
param: string   $type       Filter for the variable, for valid values see {@link InputFilter::clean()}. Optional.
param: boolean  $resetPage  If true, the limitstart in request is set to zero
return: mixed  The request user state.

refineSearchStringToRegex($search, $regexDelimiter = '/')   X-Ref
Parse and transform the search string into a string fit for regex-ing arbitrary strings against

param: string  $search          The search string
param: string  $regexDelimiter  The regex delimiter to use for the quoting
return: string  Search string escaped for regex



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