3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
10 namespace Zend\Feed\Reader;
13 * Default implementation of ExtensionManagerInterface
15 * Decorator of ExtensionPluginManager.
17 class ExtensionManager implements ExtensionManagerInterface
19 protected $pluginManager;
24 * Seeds the extension manager with a plugin manager; if none provided,
25 * creates an instance.
27 * @param null|ExtensionPluginManager $pluginManager
29 public function __construct(ExtensionPluginManager $pluginManager = null)
31 if (null === $pluginManager) {
32 $pluginManager = new ExtensionPluginManager();
34 $this->pluginManager = $pluginManager;
40 * Proxy to composed ExtensionPluginManager instance.
42 * @param string $method
45 * @throws Exception\BadMethodCallException
47 public function __call($method, $args)
49 if (! method_exists($this->pluginManager, $method)) {
50 throw new Exception\BadMethodCallException(sprintf(
51 'Method by name of %s does not exist in %s',
56 return call_user_func_array([$this->pluginManager, $method], $args);
60 * Get the named extension
63 * @return Extension\AbstractEntry|Extension\AbstractFeed
65 public function get($name)
67 return $this->pluginManager->get($name);
71 * Do we have the named extension?
76 public function has($name)
78 return $this->pluginManager->has($name);