lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
final public function modifyLimitQuery($query, $limit, $offset = null)
    {
        if ($limit !== null) {
            $limit = (int) $limit;
        }

        $offset = (int) $offset;

        if ($offset < 0) {
            throw new DBALException(sprintf(
                'Offset must be a positive integer or zero, %d given',
                $offset
            ));
        }

        if ($offset > 0 && ! $this->supportsLimitOffset()) {
            throw new DBALException(sprintf(
                'Platform %s does not support offset values in limit queries.',
                $this->getName()
            ));
        }

        return $this->doModifyLimitQuery($query, $limit, $offset);
    }
final public function modifyLimitQuery($query, $limit, $offset = null)
    {
        if ($limit !== null) {
            $limit = (int) $limit;
        }

        $offset = (int) $offset;

        if ($offset < 0) {
            throw new DBALException(sprintf(
                'Offset must be a positive integer or zero, %d given',
                $offset
            ));
        }

        if ($offset > 0 && ! $this->supportsLimitOffset()) {
            throw new DBALException(sprintf(
                'Platform %s does not support offset values in limit queries.',
                $this->getName()
            ));
        }

        return $this->doModifyLimitQuery($query, $limit, $offset);
    }
final public function modifyLimitQuery ( $ query , $ limit , $ offset = null ) { if ( $ limit !== null ) { $ limit = ( int ) $ limit ; } $ offset = ( int ) $ offset ; if ( $ offset < 0 ) { throw new DBALException ( sprintf ( 'Offset must be a positive integer or zero, %d given' , $ offset ) ) ; } if ( $ offset > 0 && ! $ this -> supportsLimitOffset ( ) ) { throw new DBALException ( sprintf ( 'Platform %s does not support offset values in limit queries.' , $ this -> getName ( ) ) ) ; } return $ this -> doModifyLimitQuery ( $ query , $ limit , $ offset ) ; }
Adds an driver-specific LIMIT clause to the query.

@param string   $query
@param int|null $limit
@param int|null $offset

@return string

@throws DBALException
Adds an driver - specific LIMIT clause to the query .