summaryrefslogtreecommitdiff
path: root/idiorm.php
diff options
context:
space:
mode:
authormapner <[email protected]>2013-01-29 10:15:01 +0000
committerSimon Holywell <[email protected]>2013-01-29 10:15:01 +0000
commitbc0832e020a5672793420aa253bbcfff92832599 (patch)
tree04bb23c3e6b2c7aae5c86684dcf75a56ec052a21 /idiorm.php
parent9f9fd4d5666d73e3e143a5428fd32e43abeee8f5 (diff)
Add support for Firebird limit and offset
Diffstat (limited to 'idiorm.php')
-rw-r--r--idiorm.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/idiorm.php b/idiorm.php
index 7e0c50d..66a243c 100644
--- a/idiorm.php
+++ b/idiorm.php
@@ -284,6 +284,7 @@
case 'dblib':
case 'mssql':
case 'sybase':
+ case 'firebird':
return '"';
case 'mysql':
case 'sqlite':
@@ -1375,7 +1376,11 @@
*/
protected function _build_limit() {
if (!is_null($this->_limit)) {
- return "LIMIT " . $this->_limit;
+ $clause = 'LIMIT';
+ if (self::$_db[$this->_connection_name]->getAttribute(PDO::ATTR_DRIVER_NAME) == 'firebird') {
+ $clause = 'ROWS';
+ }
+ return "$clause " . $this->_limit;
}
return '';
}
@@ -1385,7 +1390,11 @@
*/
protected function _build_offset() {
if (!is_null($this->_offset)) {
- return "OFFSET " . $this->_offset;
+ $clause = 'OFFSET';
+ if (self::$_db[$this->_connection_name]->getAttribute(PDO::ATTR_DRIVER_NAME) == 'firebird') {
+ $clause = 'TO';
+ }
+ return "$clause " . $this->_offset;
}
return '';
}