english/libraries/joomla/database/database.php
/**
	 * Method to get an array of the result set rows from the database query where each row is an object.  The array
	 * of objects can optionally be keyed by a field name, but defaults to a sequential numeric array.
	 *
	 * NOTE: Chosing to key the result array by a non-unique field name can result in unwanted
	 * behavior and should be avoided.
	 *
	 * @param   string  $key    The name of a field on which to key the result array.
	 * @param   string  $class  The class name to use for the returned row objects.
	 *
	 * @return  mixed   The return value or null if the query failed.
	 *
	 * @since   11.1
	 * @throws  DatabaseException
	 */
Method to get an array of the result set rows from the database query where each row is an object.  The array
of objects can optionally be keyed by a field name, but defaults to a sequential numeric array.

Chosing to key the result array by a non-unique field name can result in unwanted
behavior and should be avoided.

@param   string  $key    The name of a field on which to key the result array.
@param   string  $class  The class name to use for the returned row objects.

@return  mixed   The return value or null if the query failed.


Method to get an array of the result set rows from the database query where each row is an object . The array of objects can optionally be keyed by a field name but defaults to a sequential numeric array . Chosing to key the result array by a non - unique field name can result in unwanted behavior and should be avoided . @param string $key The name of a field on which to key the result array . @param string $class The class name to use for the returned row objects . @return mixed The return value or null if the query failed .
public function loadObjectList($key='', $class = 'stdClass')
	{
		$array = array();
		if (!($cursor = $this->query())) {
			return null;
		}
		while ($row = $this->fetchObject($cursor, $class))
		{
			if ($key) {
				$array[$row->$key] = $row;
			}
			else {
				$array[] = $row;
			}
		}
		$this->freeResult($cursor);
		return $array;
	}
public function loadObjectList ( $ key = '' , $ class = 'stdClass' ) { $ array = array ( ) ; if ( ! ( $ cursor = $ this -> query ( ) ) ) { return null ; } while ( $ row = $ this -> fetchObject ( $ cursor , $ class ) ) { if ( $ key ) { $ array [ $ row -> $ key ] = $ row ; } else { $ array [ ] = $ row ; } } $ this -> freeResult ( $ cursor ) ; return $ array ; }
Method to get an array of the result set rows from the database query where each row is an object.
Method to get an array of the result set rows from the database query where each row is an object .
// Initialise variables. // Execute the query and get the result set cursor. // Get all of the rows from the result set as objects of type $class. // Free up system resources and return.