diff options
author | Timothy Warren <tim@timshomepage.net> | 2012-02-20 22:01:42 +0100 |
---|---|---|
committer | Timothy Warren <tim@timshomepage.net> | 2012-02-20 22:01:42 +0100 |
commit | 51ed4ed7f6097a34ce1db7b225272bfc1b0f0bcf (patch) | |
tree | 0255694160dc3503aeba43b45769178e3edaaac3 /system | |
parent | fed2d1ddecae1886486915718cb9878b7d5aea45 (diff) |
Convert result_array to result_object instead of re-fetching
Diffstat (limited to 'system')
-rw-r--r-- | system/database/drivers/interbase/interbase_result.php | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/system/database/drivers/interbase/interbase_result.php b/system/database/drivers/interbase/interbase_result.php index c7b40d2ea..e1332ba93 100644 --- a/system/database/drivers/interbase/interbase_result.php +++ b/system/database/drivers/interbase/interbase_result.php @@ -200,6 +200,27 @@ class CI_DB_interbase_result extends CI_DB_result { { return $this->result_object; } + + // Convert result array to object so that + // We don't have to get the result again + if(count($this->result_array) > 0) + { + $i = 0; + + foreach($this->result_array as $array) + { + $this->result_object[$i] = new StdClass(); + + foreach($array as $key => $val) + { + $this->result_object[$i]->{$key} = $val; + } + + ++$i; + } + + return $this->result_object; + } // In the event that query caching is on the result_id variable // will return FALSE since there isn't a valid SQL resource so @@ -236,7 +257,11 @@ class CI_DB_interbase_result extends CI_DB_result { // the result object to an array if need be if(count($this->result_object) > 0) { - $this->result_array = (array)$this->result_object; + foreach($this->result_object as $obj) + { + $this->result_array[] = (array)$obj; + } + return $this->result_array; } |