source/Core/Database/Adapter/Doctrine/Database.php
public function selectLimit($query, $rowCount = -1, $offset = 0, $parameters = [])
    {
        /**
         * Parameter validation.
         * At the moment there will be no InvalidArgumentException thrown on non numeric values as this may break
         * too many things.
         */
        if (!is_numeric($rowCount) || !is_numeric($offset)) {
            trigger_error(
                'Parameters rowCount and offset have to be numeric in DatabaseInterface::selectLimit(). ' .
                'Please fix your code as this error may trigger an exception in future versions of OXID eShop.',
                E_USER_DEPRECATED
            );
        }

        if (0 > $offset) {
            throw new \InvalidArgumentException('Argument $offset must not be smaller than zero.');
        }

        /**
         * Cast the parameters limit and offset to integer in in order to avoid SQL injection.
         */
        $rowCount = (int) $rowCount;
        $offset = (int) $offset;
        $limitClause = '';

        if ($rowCount >= 0 && $offset >= 0) {
            $limitClause = "LIMIT $rowCount OFFSET $offset";
        }

        return $this->select($query . " $limitClause ", $parameters);
    }
public function selectLimit($query, $rowCount = -1, $offset = 0, $parameters = [])
    {
        /**
         * Parameter validation.
         * At the moment there will be no InvalidArgumentException thrown on non numeric values as this may break
         * too many things.
         */
        if (!is_numeric($rowCount) || !is_numeric($offset)) {
            trigger_error(
                'Parameters rowCount and offset have to be numeric in DatabaseInterface::selectLimit(). ' .
                'Please fix your code as this error may trigger an exception in future versions of OXID eShop.',
                E_USER_DEPRECATED
            );
        }

        if (0 > $offset) {
            throw new \InvalidArgumentException('Argument $offset must not be smaller than zero.');
        }

        /**
         * Cast the parameters limit and offset to integer in in order to avoid SQL injection.
         */
        $rowCount = (int) $rowCount;
        $offset = (int) $offset;
        $limitClause = '';

        if ($rowCount >= 0 && $offset >= 0) {
            $limitClause = "LIMIT $rowCount OFFSET $offset";
        }

        return $this->select($query . " $limitClause ", $parameters);
    }
public function selectLimit ( $ query , $ rowCount = - 1 , $ offset = 0 , $ parameters = [ ] ) { /**
         * Parameter validation.
         * At the moment there will be no InvalidArgumentException thrown on non numeric values as this may break
         * too many things.
         */ if ( ! is_numeric ( $ rowCount ) || ! is_numeric ( $ offset ) ) { trigger_error ( 'Parameters rowCount and offset have to be numeric in DatabaseInterface::selectLimit(). ' . 'Please fix your code as this error may trigger an exception in future versions of OXID eShop.' , E_USER_DEPRECATED ) ; } if ( 0 > $ offset ) { throw new \ InvalidArgumentException ( 'Argument $offset must not be smaller than zero.' ) ; } /**
         * Cast the parameters limit and offset to integer in in order to avoid SQL injection.
         */ $ rowCount = ( int ) $ rowCount ; $ offset = ( int ) $ offset ; $ limitClause = '' ; if ( $ rowCount >= 0 && $ offset >= 0 ) { $ limitClause = "LIMIT $rowCount OFFSET $offset" ; } return $ this -> select ( $ query . " $limitClause " , $ parameters ) ; }
Return the results of a given sql SELECT or SHOW statement limited by a LIMIT clause as a ResultSet.
Throws an exception for any other statement.

The values of first row of the result may be via resultSet's fields property.
This property is an array, which keys may be numeric, strings or both, depending on the FETCH_MODE_* of the connection.
All further rows can be accessed via the specific methods of ResultSet.

IMPORTANT:
You are strongly encouraged to use prepared statements like this:
$resultSet = DatabaseProvider::getDb->selectLimit(
'SELECT * FROM ´mytable´ WHERE ´id´ = ? OR ´id´ = ?',
$rowCount,
$offset,
array($id1, $id2)
);
If you do not use prepared statements, you MUST quote variables the values with quote(), otherwise you create a
SQL injection vulnerability.

Be aware that only a few database vendors have the LIMIT clause as known from MySQL.
The Doctrine Query Builder should be used here.

@param string $query      The sql select statement to be executed.
@param int    $rowCount   Maximum number of rows to return
@param int    $offset     Offset of the first row to return
@param array  $parameters The parameters array.

@throws DatabaseErrorException The exception, that can occur while executing the sql statement.
@throws \InvalidArgumentException The exception for invalid $offset.

@return \OxidEsales\Eshop\Core\Database\Adapter\ResultSetInterface The result of the given query.
Return the results of a given sql SELECT or SHOW statement limited by a LIMIT clause as a ResultSet . Throws an exception for any other statement .