API17:JDatabase::loadObjectList
From Joomla! Documentation
(Difference between revisions)
(Layout updates) |
(addes small example) |
||
| (One intermediate revision by one user not shown) | |||
| Line 2: | Line 2: | ||
=={{JVer|11.1}} JDatabase::loadObjectList== | =={{JVer|11.1}} JDatabase::loadObjectList== | ||
===Description=== | ===Description=== | ||
| − | + | Method to get an array of the result set rows from the database query where each row is an object. | |
{{Description:JDatabase::loadObjectList}} | {{Description:JDatabase::loadObjectList}} | ||
| Line 8: | Line 8: | ||
<nowiki>[</nowiki>[[Description:JDatabase::loadObjectList|Edit Descripton]]<nowiki>]</nowiki> | <nowiki>[</nowiki>[[Description:JDatabase::loadObjectList|Edit Descripton]]<nowiki>]</nowiki> | ||
</span> | </span> | ||
| − | |||
<source lang="php"> | <source lang="php"> | ||
| − | public | + | public function loadObjectList ( |
| + | $key='' | ||
| + | $class= 'stdClass' | ||
| + | ) | ||
</source> | </source> | ||
{| class="wikitable" | {| class="wikitable" | ||
| Line 20: | Line 22: | ||
|- | |- | ||
|$key | |$key | ||
| − | | | + | | |
|'' | |'' | ||
| − | | | + | | |
| + | |- | ||
| + | |$class | ||
| + | | | ||
| + | |'stdClass' | ||
| + | | | ||
|- | |- | ||
|} | |} | ||
| − | + | * '''Returns''' | |
| − | + | * '''Defined''' on line 707 of libraries/joomla/database/database.php | |
| − | + | ||
| − | libraries/joomla/database/database.php | + | |
| − | + | ||
| − | + | ||
===See also=== | ===See also=== | ||
| + | * {{JVer|11.1}} '''JDatabase::loadObjectList source code''' on [[jplatform:database/database.php#cl-699|BitBucket]] | ||
| + | * {{JVer|11.1}} Class [[JDatabase/11.1|JDatabase]] | ||
| + | * {{JVer|11.1}} Subpackage [[Subpackage_Database/11.1|Database]] | ||
| + | * [[JDatabase::loadObjectList|Other versions of JDatabase::loadObjectList]] | ||
| + | {{SeeAlso:JDatabase::loadObjectList}} | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
<nowiki>[</nowiki>[[SeeAlso:JDatabase::loadObjectList|Edit See Also]]<nowiki>]</nowiki> | <nowiki>[</nowiki>[[SeeAlso:JDatabase::loadObjectList|Edit See Also]]<nowiki>]</nowiki> | ||
</span> | </span> | ||
| − | + | ===User contributed notes=== | |
| − | + | ||
| − | + | ||
===Examples=== | ===Examples=== | ||
| + | |||
| + | <source lang="php"> | ||
| + | // Create a new query object. | ||
| + | $db = &JFactory::getDBO(); | ||
| + | $query = $db->getQuery(true); | ||
| + | $query->select('cats.description AS description, cats.title AS titel'); | ||
| + | $query->from('#__categories AS cats'); | ||
| + | $query->where('cats.id="1"'); | ||
| + | $db->setQuery($query); | ||
| + | $Category = $db->loadObjectList(); | ||
| + | </source> | ||
| + | |||
| + | |||
<CodeExamplesForm /> | <CodeExamplesForm /> | ||
<dpl> | <dpl> | ||
| Line 46: | Line 66: | ||
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
| + | namespace=CodeExample | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
<noinclude>[[Category:JDatabase]][[Category:JDatabase::loadObjectList]]</noinclude> | <noinclude>[[Category:JDatabase]][[Category:JDatabase::loadObjectList]]</noinclude> | ||
Revision as of 16:33, 26 June 2012
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.
JDatabase::loadObjectList
Description
Method to get an array of the result set rows from the database query where each row is an object.
Description:JDatabase::loadObjectList [Edit Descripton]
public function loadObjectList ( $key='' $class= 'stdClass' )
| Parameter | Type | Default | Description |
|---|---|---|---|
| $key | |||
| $class | 'stdClass' |
- Returns
- Defined on line 707 of libraries/joomla/database/database.php
See also
-
JDatabase::loadObjectList source code on BitBucket
-
Class JDatabase
-
Subpackage Database
- Other versions of JDatabase::loadObjectList
SeeAlso:JDatabase::loadObjectList [Edit See Also]
User contributed notes
Examples
// Create a new query object. $db = &JFactory::getDBO(); $query = $db->getQuery(true); $query->select('cats.description AS description, cats.title AS titel'); $query->from('#__categories AS cats'); $query->where('cats.id="1"'); $db->setQuery($query); $Category = $db->loadObjectList();
<CodeExamplesForm />
