You are here

protected function DefaultPluginManager::getDiscovery in Service Container 7

Same name and namespace in other branches
  1. 7.2 lib/Drupal/Component/Plugin/DefaultPluginManager.php \Drupal\Core\Plugin\DefaultPluginManager::getDiscovery()

Gets the plugin discovery.

Return value

\Drupal\Component\Plugin\Discovery\DiscoveryInterface

Overrides PluginManagerBase::getDiscovery

File

lib/Drupal/Component/Plugin/DefaultPluginManager.php, line 279
Contains \Drupal\Core\Plugin\DefaultPluginManager.

Class

DefaultPluginManager
Base class for plugin managers.

Namespace

Drupal\Core\Plugin

Code

protected function getDiscovery() {
  if (!$this->discovery) {
    $discovery = new AnnotatedClassDiscovery($this->subdir, $this->namespaces, $this->pluginDefinitionAnnotationName);
    $this->discovery = new ContainerDerivativeDiscoveryDecorator($discovery);
  }
  return $this->discovery;
}