summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/oci8
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-02-12 19:40:53 +0100
committerAndrey Andreev <narf@bofh.bg>2012-02-12 19:40:53 +0100
commit574c85df35b68251c178510649b88b61eb84a43d (patch)
treeda2b8f195de53fc0d9b086a4e6487c8254d64310 /system/database/drivers/oci8
parenta563fac0fb822169eb4ee8a5f98324bdab15321b (diff)
Improve custom_result_object() method
Diffstat (limited to 'system/database/drivers/oci8')
-rw-r--r--system/database/drivers/oci8/oci8_result.php11
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];
}
// --------------------------------------------------------------------