diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-07-06 10:57:37 +0200 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-07-06 10:57:37 +0200 |
commit | 9a4f356846daa078c077cbadb227524c857b8f97 (patch) | |
tree | bb6b3ee33c3056438149a252a593cae9eed92390 /system/database/drivers/sqlite | |
parent | 9e3a83a65668cc26b685f0b35a4428809435f7c9 (diff) |
_fetch_object(), custom_result_object() to utilize PHP's native capability to directly return custom class results
Diffstat (limited to 'system/database/drivers/sqlite')
-rw-r--r-- | system/database/drivers/sqlite/sqlite_result.php | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/system/database/drivers/sqlite/sqlite_result.php b/system/database/drivers/sqlite/sqlite_result.php index 307dec5a9..eef9787a1 100644 --- a/system/database/drivers/sqlite/sqlite_result.php +++ b/system/database/drivers/sqlite/sqlite_result.php @@ -143,17 +143,12 @@ class CI_DB_sqlite_result extends CI_DB_result { * * Returns the result set as an object * + * @param string * @return object */ - protected function _fetch_object() + protected function _fetch_object($class_name = 'stdClass') { - if (function_exists('sqlite_fetch_object')) - { - return sqlite_fetch_object($this->result_id); - } - - $arr = sqlite_fetch_array($this->result_id, SQLITE_ASSOC); - return is_array($arr) ? (object) $arr : FALSE; + return sqlite_fetch_object($this->result_id, $class_name); } } |