Class JModelList
Model class for handling lists of items.
-
JObject
-
JModelLegacy
-
JModelList
Methods summary
public
|
#
__construct( array $config = array() )
Constructor.
Parameters
- $config
array - $config An optional associative array of configuration settings.
Throws
Since
1.6
See
Overrides
|
protected
JDatabaseQuery
|
#
_getListQuery( )
Method to cache the last query constructed.
Method to cache the last query constructed.
This method ensures that the query is constructed only once for a given state
of the model.
Returns
Since
1.6
|
public
array
|
#
getActiveFilters( )
Function to get the active filters
Function to get the active filters
Returns
array - Associative array in the format: array('filter_published' => 0)
Since
3.2
|
public
mixed
|
#
getItems( )
Method to get an array of data items.
Method to get an array of data items.
Returns
mixed - An array of data items on success, false on failure.
Since
1.6
|
protected
JDatabaseQuery
|
#
getListQuery( )
Method to get a JDatabaseQuery object for retrieving the data set from a
database.
Method to get a JDatabaseQuery object for retrieving the data set from a
database.
Returns
Since
1.6
|
protected
string
|
#
getStoreId( string $id = '' )
Method to get a store id based on the model configuration state.
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.
Parameters
- $id
string - $id An identifier string to generate the store id.
Returns
string - A store id.
Since
1.6
|
public
integer
|
#
getTotal( )
Method to get the total number of items for the data set.
Method to get the total number of items for the data set.
Returns
integer - The total number of items available in the data set.
Since
1.6
|
public
integer
|
#
getStart( )
Method to get the starting number of items for the data set.
Method to get the starting number of items for the data set.
Returns
integer - The starting number of items available in the data set.
Since
1.6
|
public
JForm |boolean
|
#
getFilterForm( array $data = array(), boolean $loadData = true )
Get the filter form
Parameters
- $data
array - $data data
- $loadData
boolean - $loadData load current data
Returns
JForm |boolean
- The JForm object or false on error
Since
3.2
|
protected
JForm |boolean
|
#
loadForm( string $name, string $source = null, array $options = array(), boolean $clear = false, string|boolean $xpath = false )
Method to get a form object.
Method to get a form object.
Parameters
- $name
string - $name The name of the form.
- $source
string - $source The form source. Can be XML string if file flag is set to false.
- $options
array - $options Optional array of options for the form creation.
- $clear
boolean - $clear Optional argument to force load a new form.
- $xpath
string|boolean - $xpath An optional xpath to search for the fields.
Returns
JForm |boolean
- JForm object on success, False on error.
Since
3.2
See
|
protected
mixed
|
#
loadFormData( )
Method to get the data that should be injected in the form.
Method to get the data that should be injected in the form.
Returns
mixed - The data for the form.
Since
3.2
|
protected
|
#
populateState( string $ordering = null, string $direction = null )
Method to auto-populate the model state.
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.
Parameters
- $ordering
string - $ordering An optional ordering field.
- $direction
string - $direction An optional direction (asc|desc).
Since
1.6
Overrides
|
protected
|
#
preprocessForm( JForm $form, mixed $data, string $group = 'content' )
Method to allow derived classes to preprocess the form.
Method to allow derived classes to preprocess the form.
Parameters
- $form
JForm - $form A JForm object.
- $data
mixed - $data The data expected for the form.
- $group
string - $group The name of the plugin group to import (defaults to "content").
Throws
Exception
- if there is an error in the form event.
Since
3.2
|
public
mixed
|
#
getUserStateFromRequest( string $key, string $request, string $default = null, string $type = 'none', boolean $resetPage = true )
Gets the value of a user state variable and sets it in the session
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
Parameters
- $key
string - $key The key of the user state variable.
- $request
string - $request The name of the variable passed in a request.
- $default
string - $default The default value for the variable if not found. Optional.
- $type
string - $type Filter for the variable, for valid values see JFilterInput::clean() . Optional.
- $resetPage
boolean - $resetPage If true, the limitstart in request is set to zero
Returns
mixed - The request user state.
Since
1.6
|
protected
string
|
#
refineSearchStringToRegex( string $search, string $regexDelimiter = '/' )
Parse and transform the search string into a string fit for regex-ing
arbitrary strings against
Parse and transform the search string into a string fit for regex-ing
arbitrary strings against
Parameters
- $search
string - $search The search string
- $regexDelimiter
string - $regexDelimiter The regex delimiter to use for the quoting
Returns
string - Search string escaped for regex
Since
3.4
|
_createFileName()
,
_createTable()
,
_getList()
,
_getListCount()
,
addIncludePath()
,
addTablePath()
,
cleanCache()
,
getDbo()
,
getInstance()
,
getName()
,
getState()
,
getTable()
,
loadHistory()
,
setDbo()
,
setState()
Methods inherited from JObject
__toString()
,
def()
,
get()
,
getError()
,
getErrors()
,
getProperties()
,
set()
,
setError()
,
setProperties()
Magic methods summary
Properties summary
protected
array
|
$cache
|
#
Internal memory based cache array of data.
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.
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.
Valid filter fields or ordering.
Since
1.6
|
protected
JDatabaseQuery[]
|
$query
|
#
An internal cache for the last query used.
An internal cache for the last query used.
Since
1.6
|
protected
string
|
$filterFormName
|
#
Name of the filter form to load
Name of the filter form to load
Since
3.2
|
protected
string
|
$htmlFormName
|
#
Associated HTML form
Since
3.2
|
protected
array
|
$filterBlacklist
|
#
A blacklist of filter variables to not merge into the model's state
A blacklist of filter variables to not merge into the model's state
Since
3.4.5
|
protected
array
|
$listBlacklist
|
#
A blacklist of list variables to not merge into the model's state
A blacklist of list variables to not merge into the model's state
Since
3.4.5
|
Properties inherited from JModelLegacy
$__state_set
,
$_db
,
$event_clean_cache
,
$name
,
$option
,
$state
Properties inherited from JObject
$_errors