summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-06-18 12:30:45 +0200
committerAndrey Andreev <narf@bofh.bg>2012-06-18 12:30:45 +0200
commit777153d8362ed884fc3d47ea4a5e1fa0f1ce8ca9 (patch)
tree26ae7b9c855e635a50aa4b2bc8ad188fbb792530 /system
parentfad14b25148ca7202a036dc2b764feb0c8518838 (diff)
Changed limit() and offset() to ignore NULL values
Diffstat (limited to 'system')
-rw-r--r--system/database/DB_query_builder.php10
1 files changed, 3 insertions, 7 deletions
diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php
index 4c54b1c0a..d21f15066 100644
--- a/system/database/DB_query_builder.php
+++ b/system/database/DB_query_builder.php
@@ -1042,12 +1042,8 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
*/
public function limit($value, $offset = NULL)
{
- $this->qb_limit = (int) $value;
-
- if ( ! empty($offset))
- {
- $this->qb_offset = (int) $offset;
- }
+ is_null($value) OR $this->qb_limit = (int) $value;
+ empty($offset) OR $this->qb_offset = (int) $offset;
return $this;
}
@@ -1062,7 +1058,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
*/
public function offset($offset)
{
- $this->qb_offset = (int) $offset;
+ empty($offset) OR $this->qb_offset = (int) $offset;
return $this;
}