diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-02-12 19:40:53 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-02-12 19:40:53 +0100 |
commit | 574c85df35b68251c178510649b88b61eb84a43d (patch) | |
tree | da2b8f195de53fc0d9b086a4e6487c8254d64310 /system/database | |
parent | a563fac0fb822169eb4ee8a5f98324bdab15321b (diff) |
Improve custom_result_object() method
Diffstat (limited to 'system/database')
-rw-r--r-- | system/database/drivers/oci8/oci8_result.php | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/system/database/drivers/oci8/oci8_result.php b/system/database/drivers/oci8/oci8_result.php index 7781b5bbd..ce6aa996f 100644 --- a/system/database/drivers/oci8/oci8_result.php +++ b/system/database/drivers/oci8/oci8_result.php @@ -306,7 +306,7 @@ class CI_DB_oci8_result extends CI_DB_result { */ public function custom_result_object($class_name) { - if (array_key_exists($class_name, $this->custom_result_object)) + if (isset($this->custom_result_object[$class_name])) { return $this->custom_result_object[$class_name]; } @@ -332,18 +332,17 @@ class CI_DB_oci8_result extends CI_DB_result { $data = &$this->result_object; } - $result_object = array(); + $this->custom_result_object[$class_name] = array(); for ($i = 0, $c = count($data); $i < $c; $i++) { - $result_object[$i] = new $class_name(); + $this->custom_result_object[$class_name][$i] = new $class_name(); foreach ($data[$i] as $key => $value) { - $result_object[$i]->$key = $value; + $this->custom_result_object[$class_name][$i]->$key = $value; } } - // Cache and return the array - return $this->custom_result_object[$class_name] = $result_object; + return $this->custom_result_object[$class_name]; } // -------------------------------------------------------------------- |