From 37f4b9caa02783e06dd7c5318200113409a0deb1 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Fri, 1 Jul 2011 17:56:50 -0500 Subject: backed out 648b42a75739, which was a NON-trivial whitespace commit. It broke the Typography class's string replacements, for instance --- system/database/DB_result.php | 106 +++++++++++++++++++++--------------------- 1 file changed, 53 insertions(+), 53 deletions(-) (limited to 'system/database/DB_result.php') diff --git a/system/database/DB_result.php b/system/database/DB_result.php index 06eec5124..76e1d6abb 100644 --- a/system/database/DB_result.php +++ b/system/database/DB_result.php @@ -1,4 +1,4 @@ -result_array(); - else if ($type == 'object') return $this->result_object(); - else return $this->custom_result_object($type); + if ($type == 'array') return $this->result_array(); + else if ($type == 'object') return $this->result_object(); + else return $this->custom_result_object($type); } // -------------------------------------------------------------------- - /** - * Custom query result. - * - * @param class_name A string that represents the type of object you want back - * @return array of objects - */ - function custom_result_object($class_name) - { - if (array_key_exists($class_name, $this->custom_result_object)) - { - return $this->custom_result_object[$class_name]; - } - - if ($this->result_id === FALSE OR $this->num_rows() == 0) - { - return array(); - } - - // add the data to the object - $this->_data_seek(0); - $result_object = array(); + /** + * Custom query result. + * + * @param class_name A string that represents the type of object you want back + * @return array of objects + */ + function custom_result_object($class_name) + { + if (array_key_exists($class_name, $this->custom_result_object)) + { + return $this->custom_result_object[$class_name]; + } + + if ($this->result_id === FALSE OR $this->num_rows() == 0) + { + return array(); + } + + // add the data to the object + $this->_data_seek(0); + $result_object = array(); while ($row = $this->_fetch_object()) - { - $object = new $class_name(); - foreach ($row as $key => $value) - { - $object->$key = $value; - } + { + $object = new $class_name(); + foreach ($row as $key => $value) + { + $object->$key = $value; + } $result_object[] = $object; } - // return the array - return $this->custom_result_object[$class_name] = $result_object; - } + // return the array + return $this->custom_result_object[$class_name] = $result_object; + } /** - * Query result. "object" version. + * Query result. "object" version. * * @access public * @return object @@ -122,7 +122,7 @@ class CI_DB_result { // -------------------------------------------------------------------- /** - * Query result. "array" version. + * Query result. "array" version. * * @access public * @return array @@ -154,7 +154,7 @@ class CI_DB_result { // -------------------------------------------------------------------- /** - * Query result. Acts as a wrapper function for the following functions. + * Query result. Acts as a wrapper function for the following functions. * * @access public * @param string @@ -180,9 +180,9 @@ class CI_DB_result { $n = 0; } - if ($type == 'object') return $this->row_object($n); - else if ($type == 'array') return $this->row_array($n); - else return $this->custom_row_object($n, $type); + if ($type == 'object') return $this->row_object($n); + else if ($type == 'array') return $this->row_array($n); + else return $this->custom_row_object($n, $type); } // -------------------------------------------------------------------- @@ -219,7 +219,7 @@ class CI_DB_result { // -------------------------------------------------------------------- - /** + /** * Returns a single result row - custom object version * * @access public @@ -242,7 +242,7 @@ class CI_DB_result { return $result[$this->current_row]; } - /** + /** * Returns a single result row - object version * * @access public @@ -383,9 +383,9 @@ class CI_DB_result { /** * The following functions are normally overloaded by the identically named * methods in the platform-specific driver -- except when query caching - * is used. When caching is enabled we do not load the other driver. + * is used. When caching is enabled we do not load the other driver. * These functions are primarily here to prevent undefined function errors - * when a cached result object is in use. They are not otherwise fully + * when a cached result object is in use. They are not otherwise fully * operational due to the unavailability of the database resource IDs with * cached results. */ -- cgit v1.2.3-24-g4f1b From cfe49186f26cd7bb6410abd4f1069b49325dc0e9 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 20 Oct 2011 09:44:48 +0300 Subject: Some public and protected method declarations --- system/database/DB_result.php | 46 +++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'system/database/DB_result.php') diff --git a/system/database/DB_result.php b/system/database/DB_result.php index 0c4e78105..48d66c8e4 100644 --- a/system/database/DB_result.php +++ b/system/database/DB_result.php @@ -45,7 +45,7 @@ class CI_DB_result { * @param string can be "object" or "array" * @return mixed either a result object or array */ - function result($type = 'object') + public function result($type = 'object') { if ($type == 'array') return $this->result_array(); else if ($type == 'object') return $this->result_object(); @@ -60,7 +60,7 @@ class CI_DB_result { * @param class_name A string that represents the type of object you want back * @return array of objects */ - function custom_result_object($class_name) + public function custom_result_object($class_name) { if (array_key_exists($class_name, $this->custom_result_object)) { @@ -79,12 +79,12 @@ class CI_DB_result { while ($row = $this->_fetch_object()) { $object = new $class_name(); - + foreach ($row as $key => $value) { $object->$key = $value; } - + $result_object[] = $object; } @@ -100,7 +100,7 @@ class CI_DB_result { * @access public * @return object */ - function result_object() + public function result_object() { if (count($this->result_object) > 0) { @@ -132,7 +132,7 @@ class CI_DB_result { * @access public * @return array */ - function result_array() + public function result_array() { if (count($this->result_array) > 0) { @@ -166,7 +166,7 @@ class CI_DB_result { * @param string can be "object" or "array" * @return mixed either a result object or array */ - function row($n = 0, $type = 'object') + public function row($n = 0, $type = 'object') { if ( ! is_numeric($n)) { @@ -198,7 +198,7 @@ class CI_DB_result { * @access public * @return object */ - function set_row($key, $value = NULL) + public function set_row($key, $value = NULL) { // We cache the row data for subsequent uses if ( ! is_array($this->row_data)) @@ -230,7 +230,7 @@ class CI_DB_result { * @access public * @return object */ - function custom_row_object($n, $type) + public function custom_row_object($n, $type) { $result = $this->custom_result_object($type); @@ -253,7 +253,7 @@ class CI_DB_result { * @access public * @return object */ - function row_object($n = 0) + public function row_object($n = 0) { $result = $this->result_object(); @@ -278,7 +278,7 @@ class CI_DB_result { * @access public * @return array */ - function row_array($n = 0) + public function row_array($n = 0) { $result = $this->result_array(); @@ -304,7 +304,7 @@ class CI_DB_result { * @access public * @return object */ - function first_row($type = 'object') + public function first_row($type = 'object') { $result = $this->result($type); @@ -323,7 +323,7 @@ class CI_DB_result { * @access public * @return object */ - function last_row($type = 'object') + public function last_row($type = 'object') { $result = $this->result($type); @@ -342,7 +342,7 @@ class CI_DB_result { * @access public * @return object */ - function next_row($type = 'object') + public function next_row($type = 'object') { $result = $this->result($type); @@ -367,7 +367,7 @@ class CI_DB_result { * @access public * @return object */ - function previous_row($type = 'object') + public function previous_row($type = 'object') { $result = $this->result($type); @@ -394,14 +394,14 @@ class CI_DB_result { * operational due to the unavailability of the database resource IDs with * cached results. */ - function num_rows() { return $this->num_rows; } - function num_fields() { return 0; } - function list_fields() { return array(); } - function field_data() { return array(); } - function free_result() { return TRUE; } - function _data_seek() { return TRUE; } - function _fetch_assoc() { return array(); } - function _fetch_object() { return array(); } + public function num_rows() { return $this->num_rows; } + public function num_fields() { return 0; } + public function list_fields() { return array(); } + public function field_data() { return array(); } + public function free_result() { return TRUE; } + protected function _data_seek() { return TRUE; } + protected function _fetch_assoc() { return array(); } + protected function _fetch_object() { return array(); } } // END DB_result class -- cgit v1.2.3-24-g4f1b