From b116d3ad3faeecedca368658fe5fbcf493155812 Mon Sep 17 00:00:00 2001 From: zYne Date: Sun, 24 Jun 2007 20:11:41 +0000 Subject: [PATCH] --- lib/Doctrine/Connection/Common.php | 31 ++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/lib/Doctrine/Connection/Common.php b/lib/Doctrine/Connection/Common.php index b6e90ebf4..b5da453ff 100644 --- a/lib/Doctrine/Connection/Common.php +++ b/lib/Doctrine/Connection/Common.php @@ -1,7 +1,27 @@ . + */ Doctrine::autoload('Doctrine_Connection'); /** * standard connection, the parent of pgsql, mysql and sqlite + * * @package Doctrine * @category Object Relational Mapping * @link www.phpdoctrine.com @@ -19,14 +39,17 @@ class Doctrine_Connection_Common extends Doctrine_Connection * @param mixed $limit * @param mixed $offset */ - public function modifyLimitQuery($query,$limit = false,$offset = false,$isManip=false) + public function modifyLimitQuery($query, $limit = false,$offset = false,$isManip=false) { + $limit = (int) $limit; + $offset = (int) $offset; + if ($limit && $offset) { - $query .= " LIMIT ".$limit." OFFSET ".$offset; + $query .= ' LIMIT ' . $limit . ' OFFSET ' . $offset; } elseif ($limit && ! $offset) { - $query .= " LIMIT ".$limit; + $query .= ' LIMIT ' . $limit; } elseif ( ! $limit && $offset) { - $query .= " LIMIT 999999999999 OFFSET ".$offset; + $query .= ' LIMIT 999999999999 OFFSET ' . $offset; } return $query;