Документация по Joomla 1.7

Joomla.Platform\JModelList
libraries/joomla/application/component/modellist.php at line 21

Class JModelList

JObject
└─JModel
└─JModelList
All Known Subclasses:
Joomla.Administrator\BannersModelBanners Joomla.Site\BannersModelBanners Joomla.Administrator\BannersModelClients Joomla.Administrator\BannersModelTracks Joomla.Administrator\CacheModelCache Joomla.Administrator\CategoriesModelCategories Joomla.Administrator\CheckinModelCheckin Joomla.Site\ContactModelCategory Joomla.Administrator\ContactModelContacts Joomla.Site\ContactModelFeatured Joomla.Administrator\ContentModelArticles Joomla.Site\ContentModelArticles Joomla.Site\ContentModelCategory Joomla.Administrator\InstallerModel Joomla.Administrator\InstallerModelUpdate Joomla.Administrator\InstallerModelWarnings Joomla.Administrator\LanguagesModelInstalled Joomla.Administrator\LanguagesModelLanguages Joomla.Administrator\MenusModelItems Joomla.Administrator\MenusModelMenus Joomla.Administrator\MessagesModelMessages Joomla.Administrator\ModulesModelModules Joomla.Administrator\ModulesModelPositions Joomla.Administrator\ModulesModelSelect Joomla.Site\NewsfeedsModelCategory Joomla.Administrator\NewsfeedsModelNewsfeeds Joomla.Administrator\PluginsModelPlugins Joomla.Administrator\RedirectModelLinks Joomla.Administrator\SearchModelSearches Joomla.Administrator\TemplatesModelStyles Joomla.Administrator\TemplatesModelTemplates Joomla.Administrator\UsersModelDebugGroup Joomla.Administrator\UsersModelDebugUser Joomla.Administrator\UsersModelGroups Joomla.Administrator\UsersModelLevels Joomla.Administrator\UsersModelUsers Joomla.Site\WeblinksModelCategory Joomla.Administrator\WeblinksModelWeblinks

public class JModelList
extends JModel

Model class for handling lists of items.

Subpackage:
Application
Since:
11.1

Field Summary
protected array

$cache

Internal memory based cache array of data.

protected string

$context

Context string for the model type.

protected array

$filter_fields

Valid filter fields or ordering.

protected JDatabaseQuery

$query

An internal cache for the last query used.

Fields inherited from Joomla.Platform\JModel
__state_set, _db, event_clean_cache, name, option, state
Fields inherited from Joomla.Platform\JObject
_errors
Constructor Summary
JModelList

__construct(array config, mixed properties)

Constructor.

Method Summary
protected JDatabaseQuery

_getListQuery()

Method to cache the last query constructed.

static mixed

getItems()

Method to get an array of data items.

protected JDatabaseQuery

getListQuery()

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

JPagination

getPagination()

Method to get a JPagination object for the data set.

protected string

getStoreId(string id)

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

integer

getTotal()

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

integer

getstart()

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

protected void

populateState(string ordering, string direction)

Method to auto-populate the model state.

The

getUserStateFromRequest(string key, string request, string default, string type, boolean resetPage)

Gets the value of a user state variable and sets it in the sessionThis 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

Methods inherited from Joomla.Platform\JModel
__construct, _createFileName, _createTable, _getList, _getListCount, addIncludePath, addTablePath, cleanCache, getDbo, getInstance, getName, getState, getTable, populateState, setDbo, setState
Methods inherited from Joomla.Platform\JObject
__construct, __toString, def, get, getError, getErrors, getProperties, set, setError, setProperties, toString

Field Detail

libraries/joomla/application/component/modellist.php at line 29

cache

protected array $cache = array()

Internal memory based cache array of data.

Since:
11.1

libraries/joomla/application/component/modellist.php at line 38

context

protected string $context = null

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

Since:
11.1

libraries/joomla/application/component/modellist.php at line 46

filter_fields

protected array $filter_fields = array()

Valid filter fields or ordering.

Since:
11.1

libraries/joomla/application/component/modellist.php at line 54

query

protected JDatabaseQuery $query = array()

An internal cache for the last query used.

Since:
11.1

Constructor Detail

libraries/joomla/application/component/modellist.php at line 66

__construct

public JModelList __construct(array config, mixed properties)

Constructor.

Parameters:
config - An optional associative array of configuration settings.
See Also:
JController
Since:
11.1

Method Detail

libraries/joomla/application/component/modellist.php at line 90

_getListQuery

protected JDatabaseQuery _getListQuery()

Method to cache the last query constructed.

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

Returns:
A JDatabaseQuery object
Since:
11.1

libraries/joomla/application/component/modellist.php at line 114

getItems

public static mixed getItems()

Method to get an array of data items.

Returns:
An array of data items on success, false on failure.
Since:
11.1

libraries/joomla/application/component/modellist.php at line 147

getListQuery

protected JDatabaseQuery getListQuery()

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

Returns:
A JDatabaseQuery object to retrieve the data set.
Since:
11.1

libraries/joomla/application/component/modellist.php at line 162

getPagination

public JPagination getPagination()

Method to get a JPagination object for the data set.

Returns:
A JPagination object for the data set.
Since:
11.1

libraries/joomla/application/component/modellist.php at line 196

getStoreId

protected string getStoreId(string id)

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 - An identifier string to generate the store id.
Returns:
A store id.
Since:
11.1

libraries/joomla/application/component/modellist.php at line 214

getTotal

public integer getTotal()

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

Returns:
The total number of items available in the data set.
Since:
11.1

libraries/joomla/application/component/modellist.php at line 247

getstart

public integer getstart()

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

Returns:
The starting number of items available in the data set.
Since:
11.1

libraries/joomla/application/component/modellist.php at line 285

populateState

protected void populateState(string ordering, string direction)

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 - An optional ordering field.
direction - An optional direction (asc|desc).
Since:
11.1
Note:
Calling getState in this method will result in recursion.

libraries/joomla/application/component/modellist.php at line 337

getUserStateFromRequest

public The getUserStateFromRequest(string key, string request, string default, string type, boolean resetPage)

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 - The key of the user state variable.
request - The name of the variable passed in a request.
default - The default value for the variable if not found. Optional.
type - Filter for the variable, for valid values see {@link JFilterInput::clean()}. Optional.
resetPage - If true, the limitstart in request is set to zero
Returns:
request user state.
Since:
11.1

Документация по Joomla 1.7