framework/db/ar/CActiveFinder.php
public function query($criteria,$all=false)
	{
		$this->joinAll=$criteria->together===true;

		if($criteria->alias!='')
		{
			$this->_joinTree->tableAlias=$criteria->alias;
			$this->_joinTree->rawTableAlias=$this->_builder->getSchema()->quoteTableName($criteria->alias);
		}

		$this->_joinTree->find($criteria);
		$this->_joinTree->afterFind();

		if($all)
		{
			$result = array_values($this->_joinTree->records);
			if ($criteria->index!==null)
			{
				$index=$criteria->index;
				$array=array();
				foreach($result as $object)
					$array[$object->$index]=$object;
				$result=$array;
			}
		}
		elseif(count($this->_joinTree->records))
			$result = reset($this->_joinTree->records);
		else
			$result = null;

		$this->destroyJoinTree();
		return $result;
	}
public function query($criteria,$all=false)
	{
		$this->joinAll=$criteria->together===true;

		if($criteria->alias!='')
		{
			$this->_joinTree->tableAlias=$criteria->alias;
			$this->_joinTree->rawTableAlias=$this->_builder->getSchema()->quoteTableName($criteria->alias);
		}

		$this->_joinTree->find($criteria);
		$this->_joinTree->afterFind();

		if($all)
		{
			$result = array_values($this->_joinTree->records);
			if ($criteria->index!==null)
			{
				$index=$criteria->index;
				$array=array();
				foreach($result as $object)
					$array[$object->$index]=$object;
				$result=$array;
			}
		}
		elseif(count($this->_joinTree->records))
			$result = reset($this->_joinTree->records);
		else
			$result = null;

		$this->destroyJoinTree();
		return $result;
	}
public function query ( $ criteria , $ all = false ) { $ this -> joinAll = $ criteria -> together === true ; if ( $ criteria -> alias != '' ) { $ this -> _joinTree -> tableAlias = $ criteria -> alias ; $ this -> _joinTree -> rawTableAlias = $ this -> _builder -> getSchema ( ) -> quoteTableName ( $ criteria -> alias ) ; } $ this -> _joinTree -> find ( $ criteria ) ; $ this -> _joinTree -> afterFind ( ) ; if ( $ all ) { $ result = array_values ( $ this -> _joinTree -> records ) ; if ( $ criteria -> index !== null ) { $ index = $ criteria -> index ; $ array = array ( ) ; foreach ( $ result as $ object ) $ array [ $ object -> $ index ] = $ object ; $ result = $ array ; } } elseif ( count ( $ this -> _joinTree -> records ) ) $ result = reset ( $ this -> _joinTree -> records ) ; else $ result = null ; $ this -> destroyJoinTree ( ) ; return $ result ; }
Do not call this method. This method is used internally to perform the relational query
based on the given DB criteria.
@param CDbCriteria $criteria the DB criteria
@param boolean $all whether to bring back all records
@return mixed the query result
Do not call this method . This method is used internally to perform the relational query based on the given DB criteria .