You are here

public function DefaultPluginManager::__construct in Service Container 7.2

Same name in this branch
  1. 7.2 src/Plugin/DefaultPluginManager.php \Drupal\service_container\Plugin\DefaultPluginManager::__construct()
  2. 7.2 lib/Drupal/Component/Plugin/DefaultPluginManager.php \Drupal\Core\Plugin\DefaultPluginManager::__construct()
Same name and namespace in other branches
  1. 7 lib/Drupal/Component/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'.

File

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

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') {
  $this->subdir = $subdir;
  $this->namespaces = $namespaces;
  $this->pluginDefinitionAnnotationName = $plugin_definition_annotation_name;
  $this->pluginInterface = $plugin_interface;
  $this->moduleHandler = $module_handler;
}