original_string: public function get()
  	{
  		// Get the columns
  		$columns = $this->select();
  
  		// Start building the query
  		$select = $columns;
  		if ($this->use_subquery())
  		{
  			$select = array();
  			foreach ($columns as $c)
  			{
  				$select[] = $c[0];
  			}
  		}
  
  		$query = call_fuel_func_array('DB::select', $select);
  
  		// Set from view/table
  		$query->from(array($this->_table(), $this->alias));
  
  		// Build the query further
  		$tmp     = $this->build_query($query, $columns);
  		$query   = $tmp['query'];
  		$models  = $tmp['models'];
  
  		// Make models hierarchical
  		foreach ($models as $name => $values)
  		{
  			if (strpos($name, '.'))
  			{
  				unset($models[$name]);
  				$rels = explode('.', $name);
  				$ref =& $models[array_shift($rels)];
  				foreach ($rels as $rel)
  				{
  					empty($ref['models']) and $ref['models'] = array();
  					empty($ref['models'][$rel]) and $ref['models'][$rel] = array();
  					$ref =& $ref['models'][$rel];
  				}
  				$ref = $values;
  			}
  		}
  
  		$rows = $query->execute($this->connection)->as_array();
  		$result = array();
  		$model = $this->model;
  		$select = $this->select();
  		$primary_key = $model::primary_key();
  		foreach ($rows as $id => $row)
  		{
  			$this->hydrate($row, $models, $result, $model, $select, $primary_key);
  			unset($rows[$id]);
  		}
  
  		// It's all built, now lets execute and start hydration
  		return $result;
  	}
code: public function get()
  	{
  		// Get the columns
  		$columns = $this->select();
  
  		// Start building the query
  		$select = $columns;
  		if ($this->use_subquery())
  		{
  			$select = array();
  			foreach ($columns as $c)
  			{
  				$select[] = $c[0];
  			}
  		}
  
  		$query = call_fuel_func_array('DB::select', $select);
  
  		// Set from view/table
  		$query->from(array($this->_table(), $this->alias));
  
  		// Build the query further
  		$tmp     = $this->build_query($query, $columns);
  		$query   = $tmp['query'];
  		$models  = $tmp['models'];
  
  		// Make models hierarchical
  		foreach ($models as $name => $values)
  		{
  			if (strpos($name, '.'))
  			{
  				unset($models[$name]);
  				$rels = explode('.', $name);
  				$ref =& $models[array_shift($rels)];
  				foreach ($rels as $rel)
  				{
  					empty($ref['models']) and $ref['models'] = array();
  					empty($ref['models'][$rel]) and $ref['models'][$rel] = array();
  					$ref =& $ref['models'][$rel];
  				}
  				$ref = $values;
  			}
  		}
  
  		$rows = $query->execute($this->connection)->as_array();
  		$result = array();
  		$model = $this->model;
  		$select = $this->select();
  		$primary_key = $model::primary_key();
  		foreach ($rows as $id => $row)
  		{
  			$this->hydrate($row, $models, $result, $model, $select, $primary_key);
  			unset($rows[$id]);
  		}
  
  		// It's all built, now lets execute and start hydration
  		return $result;
  	}
code_tokens: public function get ( ) { // Get the columns $ columns = $ this -> select ( ) ; // Start building the query $ select = $ columns ; if ( $ this -> use_subquery ( ) ) { $ select = array ( ) ; foreach ( $ columns as $ c ) { $ select [ ] = $ c [ 0 ] ; } } $ query = call_fuel_func_array ( 'DB::select' , $ select ) ; // Set from view/table $ query -> from ( array ( $ this -> _table ( ) , $ this -> alias ) ) ; // Build the query further $ tmp = $ this -> build_query ( $ query , $ columns ) ; $ query = $ tmp [ 'query' ] ; $ models = $ tmp [ 'models' ] ; // Make models hierarchical foreach ( $ models as $ name => $ values ) { if ( strpos ( $ name , '.' ) ) { unset ( $ models [ $ name ] ) ; $ rels = explode ( '.' , $ name ) ; $ ref = & $ models [ array_shift ( $ rels ) ] ; foreach ( $ rels as $ rel ) { empty ( $ ref [ 'models' ] ) and $ ref [ 'models' ] = array ( ) ; empty ( $ ref [ 'models' ] [ $ rel ] ) and $ ref [ 'models' ] [ $ rel ] = array ( ) ; $ ref = & $ ref [ 'models' ] [ $ rel ] ; } $ ref = $ values ; } } $ rows = $ query -> execute ( $ this -> connection ) -> as_array ( ) ; $ result = array ( ) ; $ model = $ this -> model ; $ select = $ this -> select ( ) ; $ primary_key = $ model :: primary_key ( ) ; foreach ( $ rows as $ id => $ row ) { $ this -> hydrate ( $ row , $ models , $ result , $ model , $ select , $ primary_key ) ; unset ( $ rows [ $ id ] ) ; } // It's all built, now lets execute and start hydration return $ result ; }
docstring: Build the query and return hydrated results
  
  @return  array
docstring_tokens: Build the query and return hydrated results