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/odbc/odbc_result.php | 84 ++++------------------------ 1 file changed, 11 insertions(+), 73 deletions(-) (limited to 'system/database/drivers/odbc/odbc_result.php') diff --git a/system/database/drivers/odbc/odbc_result.php b/system/database/drivers/odbc/odbc_result.php index 0085ef664..1d998bea8 100644 --- a/system/database/drivers/odbc/odbc_result.php +++ b/system/database/drivers/odbc/odbc_result.php @@ -48,14 +48,22 @@ class CI_DB_odbc_result extends CI_DB_result { { return $this->num_rows; } + elseif (($this->num_rows = @odbc_num_rows($this->result_id)) !== -1) + { + return $this->num_rows; + } // Work-around for ODBC subdrivers that don't support num_rows() - if (($this->num_rows = @odbc_num_rows($this->result_id)) === -1) + if (count($this->result_array) > 0) { - $this->num_rows = count($this->result_array()); + return $this->num_rows = count($this->result_array); + } + elseif (count($this->result_object) > 0) + { + return $this->num_rows = count($this->result_object); } - return $this->num_rows; + return $this->num_rows = count($this->result_array()); } // -------------------------------------------------------------------- @@ -164,76 +172,6 @@ class CI_DB_odbc_result extends CI_DB_result { return odbc_fetch_object($this->result_id); } - // -------------------------------------------------------------------- - - /** - * Query result. Array version. - * - * @return array - */ - public function result_array() - { - if (count($this->result_array) > 0) - { - return $this->result_array; - } - elseif (($c = count($this->result_object)) > 0) - { - for ($i = 0; $i < $c; $i++) - { - $this->result_array[$i] = (array) $this->result_object[$i]; - } - } - elseif ($this->result_id === FALSE) - { - return array(); - } - else - { - while ($row = $this->_fetch_assoc()) - { - $this->result_array[] = $row; - } - } - - 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; - } - } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b