/** * Instantiate the model with the attributes * @param array $row * @return object */ public function instantiate($row) { if (!isset($this->_cachedRecord[$this->recordId($row)])) { $model = $this->_model->instantiate($this->extractRecord($row)); $this->_cachedRecord[$this->recordId($row)] = $model; } return $this->_cachedRecord[$this->recordId($row)]; }
/** * Initialize result set into object collection * * @param object $model * @param array $results */ protected function _initResults(Mad_Model_Base $model, $results) { while ($row = current($results)) { $this->_collection[] = $model->instantiate($row); next($results); } }