/**
  * Utility function for loading a complete query from cache into objects
  *
  * @param string $cacheId The class is prepended to this id
  * @param object $object The object to put the data in
  * @param mixed $sql string or \Zend_Db_Select
  * @param array $binds sql paramters
  * @param mixed $tags atring or array of strings
  * @return array
  */
 protected function _getObjectsAllCached($cacheId, $object, $sql, $binds = null, $tags = array())
 {
     $output = array();
     $rows = $this->_getSelectAllCached($cacheId, $sql, $binds, $tags);
     if ($rows) {
         $this->source->applySource($object);
         foreach ($rows as $row) {
             $tmp = clone $object;
             $tmp->exchangeArray($row);
             $output[] = $tmp;
         }
     }
     return $output;
 }
 /**
  *
  * @param mixed $container A container acting as source for \MUtil_Registry_Source
  * @param array $dirs The directories where to look for requested classes
  */
 public function __construct($container, array $dirs)
 {
     parent::__construct($container);
     if ($this->cascade) {
         $this->_dirs = $this->_cascadedDirs($dirs, $this->cascade, true);
     } else {
         $this->_dirs = $dirs;
     }
     $this->_loader = new \MUtil_Loader_PluginLoader($this->_dirs);
     if (\MUtil_Registry_Source::$verbose) {
         \MUtil_Echo::r($this->_dirs, '$this->_dirs in ' . get_class($this) . '->' . __FUNCTION__ . '():');
     }
 }
 /**
  * Called after the check that all required registry values
  * have been set correctly has run.
  *
  * @return void
  */
 public function afterRegistry()
 {
     parent::afterRegistry();
     if (!$this->importer instanceof \MUtil_Model_Importer) {
         $this->importer = new \MUtil_Model_Importer();
         $source = new \MUtil_Registry_Source(get_object_vars($this));
         $source->applySource($this->importer);
         $this->importer->setRegistrySource($source);
     }
     if (!$this->targetModel instanceof \MUtil_Model_ModelAbstract) {
         if ($this->model instanceof \MUtil_Model_ModelAbstract) {
             $this->targetModel = $this->model;
         }
     }
     if ($this->targetModel instanceof \MUtil_Model_ModelAbstract) {
         $this->importer->setTargetModel($this->targetModel);
     }
     if ($this->sourceModel instanceof \MUtil_Model_ModelAbstract) {
         $this->importer->setSourceModel($this->sourceModel);
     }
     // Cleanup any references to model to avoid confusion
     $this->model = null;
 }