You are here

public function DefaultPluginManager::__construct in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Plugin/DefaultPluginManager.php \Drupal\Core\Plugin\DefaultPluginManager::__construct()
  2. 10 core/lib/Drupal/Core/Plugin/DefaultPluginManager.php \Drupal\Core\Plugin\DefaultPluginManager::__construct()

Creates the discovery object.

Parameters

string|bool $subdir: The plugin's subdirectory, for example Plugin/views/filter.

\Traversable $namespaces: An object that implements \Traversable which contains the root paths keyed by the corresponding namespace to look for plugin implementations.

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler.

string|null $plugin_interface: (optional) The interface each plugin should implement.

string $plugin_definition_annotation_name: (optional) The name of the annotation that contains the plugin definition. Defaults to 'Drupal\Component\Annotation\Plugin'.

string[] $additional_annotation_namespaces: (optional) Additional namespaces to scan for annotation definitions.

36 calls to DefaultPluginManager::__construct()
ActionManager::__construct in core/lib/Drupal/Core/Action/ActionManager.php
Constructs a new class instance.
AggregatorPluginManager::__construct in core/modules/aggregator/src/Plugin/AggregatorPluginManager.php
Constructs a AggregatorPluginManager object.
ArchiverManager::__construct in core/lib/Drupal/Core/Archiver/ArchiverManager.php
Constructs a ArchiverManager object.
BlockManager::__construct in core/lib/Drupal/Core/Block/BlockManager.php
Constructs a new \Drupal\Core\Block\BlockManager object.
CKEditorPluginManager::__construct in core/modules/ckeditor/src/CKEditorPluginManager.php
Constructs a CKEditorPluginManager object.

... See full list

47 methods override DefaultPluginManager::__construct()
ActionManager::__construct in core/lib/Drupal/Core/Action/ActionManager.php
Constructs a new class instance.
AggregatorPluginManager::__construct in core/modules/aggregator/src/Plugin/AggregatorPluginManager.php
Constructs a AggregatorPluginManager object.
ArchiverManager::__construct in core/lib/Drupal/Core/Archiver/ArchiverManager.php
Constructs a ArchiverManager object.
BlockManager::__construct in core/lib/Drupal/Core/Block/BlockManager.php
Constructs a new \Drupal\Core\Block\BlockManager object.
BreakpointManager::__construct in core/modules/breakpoint/src/BreakpointManager.php
Constructs a new BreakpointManager instance.

... See full list

File

core/lib/Drupal/Core/Plugin/DefaultPluginManager.php, line 124

Class

DefaultPluginManager
Base class for plugin managers.

Namespace

Drupal\Core\Plugin

Code

public function __construct($subdir, \Traversable $namespaces, ModuleHandlerInterface $module_handler, $plugin_interface = NULL, $plugin_definition_annotation_name = 'Drupal\\Component\\Annotation\\Plugin', array $additional_annotation_namespaces = []) {
  $this->subdir = $subdir;
  $this->namespaces = $namespaces;
  $this->pluginDefinitionAnnotationName = $plugin_definition_annotation_name;
  $this->pluginInterface = $plugin_interface;
  $this->moduleHandler = $module_handler;
  $this->additionalAnnotationNamespaces = $additional_annotation_namespaces;
}