Firebird.php 624 Bytes
Newer Older
zYne's avatar
zYne committed
1 2 3 4 5 6
<?php
/**
 * firebird driver
 */
class Doctrine_Connection_Firebird extends Doctrine_Connection {
    public function modifyLimitQuery($query,$limit,$offset) {
7 8
        return preg_replace('/^([\s(])*SELECT(?!\s*FIRST\s*\d+)/i',
                "SELECT FIRST $limit SKIP $offset", $query);
zYne's avatar
zYne committed
9 10 11 12 13 14 15 16 17 18 19 20
    }
    /**
     * returns the next value in the given sequence
     * @param string $sequence
     * @return integer
     */
    public function getNextID($sequence) {
        $stmt = $this->query("SELECT UNIQUE FROM ".$sequence);
        $data = $stmt->fetch(PDO::FETCH_NUM);
        return $data[0];
    }
}
21