diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-03-09 13:47:53 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-03-09 13:47:53 +0100 |
commit | fb61aabd33607479bcfcaf7881bfd8fcf813d1a5 (patch) | |
tree | 6f766b26e6d36190dd5f89f09857b930594291e7 /system/database/drivers/odbc/odbc_result.php | |
parent | e35250d873e875b3a0bbc53e8a9387e7fd5a82e6 (diff) | |
parent | c016a1102e2a77e0c27b9656c19a0460df24dfb6 (diff) |
Merge upstream branch
Diffstat (limited to 'system/database/drivers/odbc/odbc_result.php')
-rw-r--r-- | system/database/drivers/odbc/odbc_result.php | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/system/database/drivers/odbc/odbc_result.php b/system/database/drivers/odbc/odbc_result.php index 2d5b50a8d..de2c58cb9 100644 --- a/system/database/drivers/odbc/odbc_result.php +++ b/system/database/drivers/odbc/odbc_result.php @@ -280,6 +280,41 @@ class CI_DB_odbc_result extends CI_DB_result { return $this->result_array; } + // -------------------------------------------------------------------- + + /** + * Query result. Object version. + * + * @return array + */ + public function result_object() + { + if (count($this->result_object) > 0) + { + return $this->result_object; + } + elseif (($c = count($this->result_array)) > 0) + { + for ($i = 0; $i < $c; $i++) + { + $this->result_object[$i] = (object) $this->result_array[$i]; + } + } + elseif ($this->result_id === FALSE) + { + return array(); + } + else + { + while ($row = $this->_fetch_object()) + { + $this->result_object[] = $row; + } + } + + return $this->result_object; + } + } /* End of file odbc_result.php */ |