Commits

Greg Aker  committed a9a1c87

Fixing up a tabs vs spaces inconsistency in DB_Result

  • Participants
  • Parent commits 648b42a

Comments (0)

Files changed (1)

File system/database/DB_result.php

 	var $result_id		  = NULL;
 	var $result_array	  = array();
 	var $result_object	  = array();
- var $custom_result_object = array();
+	var $custom_result_object = array();
 	var $current_row	  = 0;
 	var $num_rows		  = 0;
 	var $row_data		  = NULL;
 	 */
 	function result($type = 'object')
 	{
-  if ($type == 'array') return $this->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];
-  }
+	/**
+	 * 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();
-  }
+		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();
+		// 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.
 			$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);
 	}
 
 	// --------------------------------------------------------------------
 
 	// --------------------------------------------------------------------
 
- /**
+	/**
 	 * Returns a single result row - custom object version
 	 *
 	 * @access	public
 		return $result[$this->current_row];
 	}
 
- /**
+	/**
 	 * Returns a single result row - object version
 	 *
 	 * @access	public