From b7530a3548ff7a65010259d858da88e18ccd390a Mon Sep 17 00:00:00 2001 From: Manish Lakhara Date: Wed, 26 Jun 2013 10:23:23 +0530 Subject: [PATCH] Fixed the issue in which the recursion for normal rdbms results was put into recursion Which was a CI::DBresult and hence was iterating for each propery causing error --- core/MY_Model.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/MY_Model.php b/core/MY_Model.php index 369d4ab..81afe7b 100644 --- a/core/MY_Model.php +++ b/core/MY_Model.php @@ -910,10 +910,16 @@ private function _typecast(&$results, $multiple = FALSE) if ($multiple) { // Typecast each element in the results array - foreach ($results as &$result) - { + //for MongoDb + if($this -> _mongodb){ + foreach ($results as &$result) + { $this->_typecast($result); + } + }else{ + $results = $results->{$this->_return_type($multiple)}(); } + } // Single value to typecast else