Skip to content

Commit

Permalink
getLimitString() now uses 'OFFSET' text to specify the offset instead…
Browse files Browse the repository at this point in the history
… of a comma. Also, added 'ILIKE' comparison operator constant. Both changes are for better PostgreSQL compatibility.
  • Loading branch information
jstayton committed Jul 26, 2012
1 parent 1805616 commit 94a4ad8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions QueryBuilder.php
Expand Up @@ -8,7 +8,7 @@
* @copyright Copyright 2011-2012 by Justin Stayton
* @license http://en.wikipedia.org/wiki/MIT_License MIT License
* @package QueryBuilder
* @version 4.0.0
* @version 4.0.1
*/
class QueryBuilder {

Expand Down Expand Up @@ -87,6 +87,11 @@ class QueryBuilder {
*/
const NOT_LIKE = "NOT LIKE";

/**
* ILIKE comparison operator.
*/
const ILIKE = "ILIKE";

/**
* REGEXP comparison operator.
*/
Expand Down Expand Up @@ -1726,12 +1731,12 @@ public function getLimitString($includeText = true) {
return $limit;
}

$limit .= $this->limit['limit'];

if ($this->limit['offset'] !== 0) {
$limit .= $this->limit['offset'] . ", ";
$limit .= " OFFSET " . $this->limit['offset'];
}

$limit .= $this->limit['limit'];

if ($includeText && $limit) {
$limit = "LIMIT " . $limit;
}
Expand Down

0 comments on commit 94a4ad8

Please sign in to comment.