Back to BaseDatabaseModel class

Method _getList

protected object[]
_getList
(mixed $query, mixed $limitstart = 0, mixed $limit = 0)
Gets an array of objects from the results of database query.
Parameters
  • string $query The query.
  • int $limitstart Offset.
  • int $limit The number of records.
Returns
  • object[] An array of results.
Since
  • 3.0
-
  • \RuntimeException

Method _getList - Source code

/**
 * Gets an array of objects from the results of database query.
 *
 * @param   string   $query       The query.
 * @param   integer  $limitstart  Offset.
 * @param   integer  $limit       The number of records.
 *
 * @return  object[]  An array of results.
 *
 * @since   3.0
 * @throws  \RuntimeException
 */
protected function _getList($query, $limitstart = 0, $limit = 0)
{
    if (\is_string($query)) {
        $query = $this->getDbo()->getQuery(true)->setQuery($query);
    }
    $query->setLimit($limit, $limitstart);
    $this->getDbo()->setQuery($query);
    return $this->getDbo()->loadObjectList();
}