AutoloaderMulti.php

Go to the documentation of this file.
00001 <?php
00002 
00034 class Robo47_Application_Resource_AutoloaderMulti
00035 extends Zend_Application_Resource_ResourceAbstract
00036 {
00037 
00042     protected $_autoloaders = null;
00043     
00044     public function init()
00045     {
00046         if (!empty($this->_options)) {
00047             foreach ($this->_options as $name => $opts) {
00048                 $resource = new Robo47_Application_Resource_Autoloader($opts);
00049                 $resource->init();
00050                 $this->_autoloaders[$name] = $resource->getAutoloader();
00051             }
00052         } else {
00053             $message = 'Empty options in resource ' .
00054                 'Robo47_Application_Resource_AutoloaderMulti.';
00055             throw new Robo47_Application_Resource_Exception($message);
00056         }
00057     }
00058 
00065     public function getAutoloader($name)
00066     {
00067         if (isset($this->_autoloaders[$name])) {
00068             return $this->_autoloaders[$name];
00069         } else {
00070             $message = 'Autoloader \'' . $name . '\' doesn\'t exist';
00071             throw new Robo47_Application_Resource_Exception($message);
00072         }
00073     }
00074 
00080     public function getAutoloaders()
00081     {
00082         return $this->_autoloaders;
00083     }
00084 }