You are here

class ExtensionManager in Zircon Profile 8

Same name in this branch
  1. 8 vendor/zendframework/zend-feed/src/Reader/ExtensionManager.php \Zend\Feed\Reader\ExtensionManager
  2. 8 vendor/zendframework/zend-feed/src/Writer/ExtensionManager.php \Zend\Feed\Writer\ExtensionManager
Same name and namespace in other branches
  1. 8.0 vendor/zendframework/zend-feed/src/Reader/ExtensionManager.php \Zend\Feed\Reader\ExtensionManager

Default implementation of ExtensionManagerInterface

Decorator of ExtensionPluginManager.

Hierarchy

Expanded class hierarchy of ExtensionManager

File

vendor/zendframework/zend-feed/src/Reader/ExtensionManager.php, line 17

Namespace

Zend\Feed\Reader
View source
class ExtensionManager implements ExtensionManagerInterface {
  protected $pluginManager;

  /**
   * Constructor
   *
   * Seeds the extension manager with a plugin manager; if none provided,
   * creates an instance.
   *
   * @param  null|ExtensionPluginManager $pluginManager
   */
  public function __construct(ExtensionPluginManager $pluginManager = null) {
    if (null === $pluginManager) {
      $pluginManager = new ExtensionPluginManager();
    }
    $this->pluginManager = $pluginManager;
  }

  /**
   * Method overloading
   *
   * Proxy to composed ExtensionPluginManager instance.
   *
   * @param  string $method
   * @param  array $args
   * @return mixed
   * @throws Exception\BadMethodCallException
   */
  public function __call($method, $args) {
    if (!method_exists($this->pluginManager, $method)) {
      throw new Exception\BadMethodCallException(sprintf('Method by name of %s does not exist in %s', $method, __CLASS__));
    }
    return call_user_func_array([
      $this->pluginManager,
      $method,
    ], $args);
  }

  /**
   * Get the named extension
   *
   * @param  string $name
   * @return Extension\AbstractEntry|Extension\AbstractFeed
   */
  public function get($name) {
    return $this->pluginManager
      ->get($name);
  }

  /**
   * Do we have the named extension?
   *
   * @param  string $name
   * @return bool
   */
  public function has($name) {
    return $this->pluginManager
      ->has($name);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ExtensionManager::$pluginManager protected property
ExtensionManager::get public function Get the named extension Overrides ExtensionManagerInterface::get
ExtensionManager::has public function Do we have the named extension? Overrides ExtensionManagerInterface::has
ExtensionManager::__call public function Method overloading
ExtensionManager::__construct public function Constructor