src/ORM/Connect/DBQueryBuilder.php
public function buildLimitFragment(SQLSelect $query, array &$parameters)
    {
        $nl = $this->getSeparator();

        // Ensure limit is given
        $limit = $query->getLimit();
        if (empty($limit)) {
            return '';
        }

        // For literal values return this as the limit SQL
        if (!is_array($limit)) {
            return "{$nl}LIMIT $limit";
        }

        // Assert that the array version provides the 'limit' key
        if (!isset($limit['limit']) || !is_numeric($limit['limit'])) {
            throw new InvalidArgumentException(
                'DBQueryBuilder::buildLimitSQL(): Wrong format for $limit: ' . var_export($limit, true)
            );
        }

        // Format the array limit, given an optional start key
        $clause = "{$nl}LIMIT {$limit['limit']}";
        if (isset($limit['start']) && is_numeric($limit['start']) && $limit['start'] !== 0) {
            $clause .= " OFFSET {$limit['start']}";
        }
        return $clause;
    }
public function buildLimitFragment(SQLSelect $query, array &$parameters)
    {
        $nl = $this->getSeparator();

        // Ensure limit is given
        $limit = $query->getLimit();
        if (empty($limit)) {
            return '';
        }

        // For literal values return this as the limit SQL
        if (!is_array($limit)) {
            return "{$nl}LIMIT $limit";
        }

        // Assert that the array version provides the 'limit' key
        if (!isset($limit['limit']) || !is_numeric($limit['limit'])) {
            throw new InvalidArgumentException(
                'DBQueryBuilder::buildLimitSQL(): Wrong format for $limit: ' . var_export($limit, true)
            );
        }

        // Format the array limit, given an optional start key
        $clause = "{$nl}LIMIT {$limit['limit']}";
        if (isset($limit['start']) && is_numeric($limit['start']) && $limit['start'] !== 0) {
            $clause .= " OFFSET {$limit['start']}";
        }
        return $clause;
    }
public function buildLimitFragment ( SQLSelect $ query , array & $ parameters ) { $ nl = $ this -> getSeparator ( ) ; // Ensure limit is given $ limit = $ query -> getLimit ( ) ; if ( empty ( $ limit ) ) { return '' ; } // For literal values return this as the limit SQL if ( ! is_array ( $ limit ) ) { return "{$nl}LIMIT $limit" ; } // Assert that the array version provides the 'limit' key if ( ! isset ( $ limit [ 'limit' ] ) || ! is_numeric ( $ limit [ 'limit' ] ) ) { throw new InvalidArgumentException ( 'DBQueryBuilder::buildLimitSQL(): Wrong format for $limit: ' . var_export ( $ limit , true ) ) ; } // Format the array limit, given an optional start key $ clause = "{$nl}LIMIT {$limit['limit']}" ; if ( isset ( $ limit [ 'start' ] ) && is_numeric ( $ limit [ 'start' ] ) && $ limit [ 'start' ] !== 0 ) { $ clause .= " OFFSET {$limit['start']}" ; } return $ clause ; }
Return the LIMIT clause ready for inserting into a query.

@param SQLSelect $query The expression object to build from
@param array $parameters Out parameter for the resulting query parameters
@return string The finalised limit SQL fragment
Return the LIMIT clause ready for inserting into a query .