framework/db/ar/CActiveFinder.php
public function findWithBase($baseRecords)
	{
		if(!is_array($baseRecords))
			$baseRecords=array($baseRecords);
		if(is_string($this->_table->primaryKey))
		{
			foreach($baseRecords as $baseRecord)
				$this->records[$baseRecord->{$this->_table->primaryKey}]=$baseRecord;
		}
		else
		{
			foreach($baseRecords as $baseRecord)
			{
				$pk=array();
				foreach($this->_table->primaryKey as $name)
					$pk[$name]=$baseRecord->$name;
				$this->records[serialize($pk)]=$baseRecord;
			}
		}

		$query=new CJoinQuery($this);
		$this->buildQuery($query);
		if(count($query->joins)>1)
			$this->runQuery($query);
		foreach($this->children as $child)
			$child->find();

		foreach($this->stats as $stat)
			$stat->query();
	}
public function findWithBase($baseRecords)
	{
		if(!is_array($baseRecords))
			$baseRecords=array($baseRecords);
		if(is_string($this->_table->primaryKey))
		{
			foreach($baseRecords as $baseRecord)
				$this->records[$baseRecord->{$this->_table->primaryKey}]=$baseRecord;
		}
		else
		{
			foreach($baseRecords as $baseRecord)
			{
				$pk=array();
				foreach($this->_table->primaryKey as $name)
					$pk[$name]=$baseRecord->$name;
				$this->records[serialize($pk)]=$baseRecord;
			}
		}

		$query=new CJoinQuery($this);
		$this->buildQuery($query);
		if(count($query->joins)>1)
			$this->runQuery($query);
		foreach($this->children as $child)
			$child->find();

		foreach($this->stats as $stat)
			$stat->query();
	}
public function findWithBase ( $ baseRecords ) { if ( ! is_array ( $ baseRecords ) ) $ baseRecords = array ( $ baseRecords ) ; if ( is_string ( $ this -> _table -> primaryKey ) ) { foreach ( $ baseRecords as $ baseRecord ) $ this -> records [ $ baseRecord -> { $ this -> _table -> primaryKey } ] = $ baseRecord ; } else { foreach ( $ baseRecords as $ baseRecord ) { $ pk = array ( ) ; foreach ( $ this -> _table -> primaryKey as $ name ) $ pk [ $ name ] = $ baseRecord -> $ name ; $ this -> records [ serialize ( $ pk ) ] = $ baseRecord ; } } $ query = new CJoinQuery ( $ this ) ; $ this -> buildQuery ( $ query ) ; if ( count ( $ query -> joins ) > 1 ) $ this -> runQuery ( $ query ) ; foreach ( $ this -> children as $ child ) $ child -> find ( ) ; foreach ( $ this -> stats as $ stat ) $ stat -> query ( ) ; }
Performs the eager loading with the base records ready.
@param mixed $baseRecords the available base record(s).
Performs the eager loading with the base records ready .