From 78ef5a58e180e288100639c08245c6d13d157455 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 20 Mar 2012 14:43:34 +0200 Subject: Visibility declarations and cleanup for CI_DB_odbc_result --- system/database/drivers/odbc/odbc_result.php | 53 ++++++++++++++-------------- 1 file changed, 27 insertions(+), 26 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 d19fa247e..f6aee356f 100644 --- a/system/database/drivers/odbc/odbc_result.php +++ b/system/database/drivers/odbc/odbc_result.php @@ -1,13 +1,13 @@ -result_id)) { @@ -148,10 +146,9 @@ class CI_DB_odbc_result extends CI_DB_result { * this internally before fetching results to make sure the * result set starts at zero * - * @access private - * @return array + * @return bool */ - function _data_seek($n = 0) + protected function _data_seek($n = 0) { return FALSE; } @@ -163,12 +160,11 @@ class CI_DB_odbc_result extends CI_DB_result { * * Returns the result set as an array * - * @access private * @return array */ - function _fetch_assoc() + protected function _fetch_assoc() { - if (function_exists('odbc_fetch_object')) + if (function_exists('odbc_fetch_array')) { return odbc_fetch_array($this->result_id); } @@ -185,10 +181,9 @@ class CI_DB_odbc_result extends CI_DB_result { * * Returns the result set as an object * - * @access private * @return object */ - function _fetch_object() + protected function _fetch_object() { if (function_exists('odbc_fetch_object')) { @@ -200,6 +195,7 @@ class CI_DB_odbc_result extends CI_DB_result { } } + // -------------------------------------------------------------------- /** * Result - object @@ -207,21 +203,24 @@ class CI_DB_odbc_result extends CI_DB_result { * subsititutes the odbc_fetch_object function when * not available (odbc_fetch_object requires unixODBC) * - * @access private * @return object */ - function _odbc_fetch_object(& $odbc_result) { + protected function _odbc_fetch_object(& $odbc_result) + { $rs = array(); $rs_obj = FALSE; - if (odbc_fetch_into($odbc_result, $rs)) { - foreach ($rs as $k=>$v) { - $field_name= odbc_field_name($odbc_result, $k+1); + if (odbc_fetch_into($odbc_result, $rs)) + { + foreach ($rs as $k => $v) + { + $field_name = odbc_field_name($odbc_result, $k+1); $rs_obj->$field_name = $v; } } return $rs_obj; } + // -------------------------------------------------------------------- /** * Result - array @@ -229,16 +228,18 @@ class CI_DB_odbc_result extends CI_DB_result { * subsititutes the odbc_fetch_array function when * not available (odbc_fetch_array requires unixODBC) * - * @access private * @return array */ - function _odbc_fetch_array(& $odbc_result) { + protected function _odbc_fetch_array(& $odbc_result) + { $rs = array(); $rs_assoc = FALSE; - if (odbc_fetch_into($odbc_result, $rs)) { - $rs_assoc=array(); - foreach ($rs as $k=>$v) { - $field_name= odbc_field_name($odbc_result, $k+1); + if (odbc_fetch_into($odbc_result, $rs)) + { + $rs_assoc = array(); + foreach ($rs as $k => $v) + { + $field_name = odbc_field_name($odbc_result, $k+1); $rs_assoc[$field_name] = $v; } } -- cgit v1.2.3-24-g4f1b