Added the zend framework 2 library, the path is specified in line no.26 in zend_modul...
[openemr.git] / interface / modules / zend_modules / library / Zend / Feed / Writer / ExtensionManager.php
blob0bb4ce0ff03c660abb35a60b376bdf296a0bf40b
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
8 */
10 namespace Zend\Feed\Writer;
12 /**
13 * Default implementation of ExtensionManagerInterface
15 * Decorator of ExtensionPluginManager.
17 class ExtensionManager implements ExtensionManagerInterface
19 protected $pluginManager;
21 /**
22 * Constructor
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;
37 /**
38 * Method overloading
40 * Proxy to composed ExtensionPluginManager instance.
42 * @param string $method
43 * @param array $args
44 * @return mixed
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',
52 $method,
53 __CLASS__
54 ));
56 return call_user_func_array(array($this->pluginManager, $method), $args);
59 /**
60 * Get the named extension
62 * @param string $name
63 * @return Extension\AbstractEntry|Extension\AbstractFeed
65 public function get($name)
67 return $this->pluginManager->get($name);
70 /**
71 * Do we have the named extension?
73 * @param string $name
74 * @return bool
76 public function has($name)
78 return $this->pluginManager->has($name);