You are here

public function PluginManagerDecorator::__construct in Plugin 8.2

Creates a new instance.

Parameters

\Drupal\Component\Plugin\PluginManagerInterface $plugin_manager: The decorated plugin manager.

\Drupal\Component\Plugin\Discovery\DiscoveryInterface|null $discovery: A plugin discovery to use instead of the decorated plugin manager, or NULL to use the decorated plugin manager.

Overrides PluginDiscoveryDecorator::__construct

File

src/PluginManager/PluginManagerDecorator.php, line 31

Class

PluginManagerDecorator
Provides a plugin manager decorator.

Namespace

Drupal\plugin\PluginManager

Code

public function __construct(PluginManagerInterface $plugin_manager, DiscoveryInterface $discovery = NULL) {
  $this->decoratedDiscovery = $discovery ? $discovery : $plugin_manager;
  $this->decoratedFactory = $plugin_manager;
}