Common.php 736 Bytes
Newer Older
zYne's avatar
zYne committed
1 2 3 4 5 6 7 8 9 10 11 12
<?php
/**
 * standard connection, the parent of pgsql, mysql and sqlite
 */
class Doctrine_Connection_Common extends Doctrine_Connection {
    /**
     * Adds an driver-specific LIMIT clause to the query
     *
     * @param string $query
     * @param mixed $limit
     * @param mixed $offset
     */
13
    public function modifyLimitQuery($query,$limit = false,$offset = false,$isManip=false) {
zYne's avatar
zYne committed
14 15 16 17 18 19 20 21 22 23 24
        if($limit && $offset) {
            $query .= " LIMIT ".$limit." OFFSET ".$offset;
        } elseif($limit && ! $offset) {
            $query .= " LIMIT ".$limit;
        } elseif( ! $limit && $offset) {
            $query .= " LIMIT 999999999999 OFFSET ".$offset;
        }

        return $query;
    }
}
25