Ejemplo n.º 1
0
 /**
  * @return Zend_Controller_Plugin_Abstract
  */
 public function init()
 {
     $containers = $this->getOptions();
     foreach ($containers as $keyContainer => $container) {
         if (!isset($container['class'])) {
             continue;
         }
         $configs = isset($container['configs']) ? $container['configs'] : array();
         $configs += array('options' => array(), 'class' => 'Core_Model_OWM_Configuration');
         $objectConfig = new $configs['class']();
         foreach ($configs['options'] as $key => $config) {
             $methodSet = 'set' . $key;
             $methodAdd = 'add' . $key;
             if (method_exists($objectConfig, $methodSet) || method_exists($objectConfig, $methodAdd)) {
                 $objectConfig->{$methodSet}($config);
             }
         }
         unset($configs['class'], $configs['options']);
         $objectConfig->setConfigs($configs);
         $container = $container['class']::create($container['options'], $objectConfig);
         Core_Registry::setContainer($keyContainer, $container);
     }
     return Core_Registry::getContainers();
 }