JModelList/getItems: Difference between revisions
From Joomla! Documentation
New page: ===Description===
Method to get an array of data items.
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>Edit Descripton<nowiki>... |
m removing red link to edit, no existant pages |
||
| Line 3: | Line 3: | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
<nowiki>[< | <nowiki>[<! removed edit link to red link >]</nowiki> | ||
</span> | </span> | ||
<! removed transcluded page call, red link never existed > | |||
===Syntax=== | ===Syntax=== | ||
| Line 51: | Line 51: | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
<nowiki>[< | <nowiki>[<! removed edit link to red link >]</nowiki> | ||
</span> | </span> | ||
<! removed transcluded page call, red link never existed > | |||
===Examples=== | ===Examples=== | ||
| Line 66: | Line 66: | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
[[Category:Archived pages API15]] | |||
Revision as of 18:37, 12 May 2013
Description
Method to get an array of data items.
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
getItems()
Returns
mixed An array of data items on success, false on failure.
Defined in
libraries/joomla/application/component/modellist.php
Importing
jimport( 'joomla.application.component.modellist' );
Source Body
public function getItems()
{
// Get a storage key.
$store = $this->_getStoreId();
// Try to load the data from internal storage.
if (!empty($this->_cache[$store])) {
return $this->_cache[$store];
}
// Load the list items.
$query = $this->_getListQuery();
$items = $this->_getList((string) $query, $this->getState('list.start'), $this->getState('list.limit'));
// Check for a database error.
if ($this->_db->getErrorNum())
{
$this->setError($this->_db->getErrorMsg());
return false;
}
// Add the items to the internal cache.
$this->_cache[$store] = $items;
return $this->_cache[$store];
}
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />