From c7db6bb9b64c8322af4d727bcb71122cd7f09dbf Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 5 Jul 2012 15:11:20 +0300 Subject: Clean-up the separate drivers' DB result classes from no longer needed methods --- system/database/drivers/ibase/ibase_result.php | 122 +------------------------ 1 file changed, 2 insertions(+), 120 deletions(-) (limited to 'system/database/drivers/ibase') diff --git a/system/database/drivers/ibase/ibase_result.php b/system/database/drivers/ibase/ibase_result.php index 6a607f589..fdf74096f 100644 --- a/system/database/drivers/ibase/ibase_result.php +++ b/system/database/drivers/ibase/ibase_result.php @@ -37,26 +37,6 @@ */ class CI_DB_ibase_result extends CI_DB_result { - /** - * Number of rows in the result set - * - * @return int - */ - public function num_rows() - { - if (is_int($this->num_rows)) - { - return $this->num_rows; - } - - // Get the results so that you can get an accurate rowcount - $this->result(); - - return $this->num_rows; - } - - // -------------------------------------------------------------------- - /** * Number of fields in the result set * @@ -138,13 +118,7 @@ class CI_DB_ibase_result extends CI_DB_result { */ protected function _fetch_assoc() { - if (($row = @ibase_fetch_assoc($this->result_id, IBASE_FETCH_BLOBS)) !== FALSE) - { - //Increment row count - $this->num_rows++; - } - - return $row; + return @ibase_fetch_assoc($this->result_id, IBASE_FETCH_BLOBS); } // -------------------------------------------------------------------- @@ -158,99 +132,7 @@ class CI_DB_ibase_result extends CI_DB_result { */ protected function _fetch_object() { - if (($row = @ibase_fetch_object($this->result_id, IBASE_FETCH_BLOBS)) !== FALSE) - { - //Increment row count - $this->num_rows++; - } - - return $row; - } - - // -------------------------------------------------------------------- - - /** - * Query result. "object" version. - * - * @return object - */ - public function result_object() - { - if (count($this->result_object) === $this->num_rows) - { - return $this->result_object; - } - - // Convert result array to object so that - // We don't have to get the result again - if (($c = count($this->result_array)) > 0) - { - for ($i = 0; $i < $c; $i++) - { - $this->result_object[$i] = (object) $this->result_array[$i]; - } - - 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) === $this->num_rows) - { - return $this->result_array; - } - - // Since the object and array are really similar, just case - // the result object to an array if need be - if (($c = count($this->result_object)) > 0) - { - for ($i = 0; $i < $c; $i++) - { - $this->result_array[$i] = (array) $this->result_object[$i]; - } - - 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; + return @ibase_fetch_object($this->result_id, IBASE_FETCH_BLOBS); } } -- cgit v1.2.3-24-g4f1b