diff options
author | Timothy Warren <tim@timshomepage.net> | 2012-02-17 19:59:44 +0100 |
---|---|---|
committer | Timothy Warren <tim@timshomepage.net> | 2012-02-17 19:59:44 +0100 |
commit | 3a4cdc62042c56da9527e6d1d4c1ab5417839e1c (patch) | |
tree | e9d4bb7d1eae968a84d0d027a579597d45c6e6e9 /system/database/drivers/interbase/interbase_result.php | |
parent | 9fad90f60dc9613527f1a1215d89a41a45878f5c (diff) |
Workaround to fix method
Diffstat (limited to 'system/database/drivers/interbase/interbase_result.php')
-rw-r--r-- | system/database/drivers/interbase/interbase_result.php | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/system/database/drivers/interbase/interbase_result.php b/system/database/drivers/interbase/interbase_result.php index 3d5721138..37f0a108c 100644 --- a/system/database/drivers/interbase/interbase_result.php +++ b/system/database/drivers/interbase/interbase_result.php @@ -183,6 +183,68 @@ class CI_DB_interbase_result extends CI_DB_result { return @ibase_fetch_object($this->result_id); } + + // -------------------------------------------------------------------- + + /** + * Query result. "object" version. + * + * @return object + */ + public function result_object() + { + if (count($this->result_object) > 0) + { + 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 + // we'll simply return an empty array. + if ($this->result_id === FALSE) + { + return array(); + } + + $this->num_rows = 0; + while ($row = $this->_fetch_object()) + { + $this->result_object[] = $row; + } + + return $this->result_object; + } + + // -------------------------------------------------------------------- + + /** + * Query result. "array" version. + * + * @return array + */ + public function result_array() + { + if (count($this->result_array) > 0) + { + return $this->result_array; + } + + // In the event that query caching is on the result_id variable + // will return FALSE since there isn't a valid SQL resource so + // we'll simply return an empty array. + if ($this->result_id === FALSE) + { + return array(); + } + + $this->num_rows = 0; + while ($row = $this->_fetch_assoc()) + { + $this->result_array[] = $row; + } + + return $this->result_array; + } } |