You are here

public function PluginManager::__construct in Express 8

Creates the discovery object.

Parameters

\Drupal\bootstrap\Theme $theme: The theme to use for discovery.

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

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

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

Overrides DefaultPluginManager::__construct

7 calls to PluginManager::__construct()
AlterManager::__construct in themes/contrib/bootstrap/src/Plugin/AlterManager.php
Constructs a new \Drupal\bootstrap\Plugin\AlterManager object.
FormManager::__construct in themes/contrib/bootstrap/src/Plugin/FormManager.php
Constructs a new \Drupal\bootstrap\Plugin\FormManager object.
PreprocessManager::__construct in themes/contrib/bootstrap/src/Plugin/PreprocessManager.php
Constructs a new \Drupal\bootstrap\Plugin\PreprocessManager object.
PrerenderManager::__construct in themes/contrib/bootstrap/src/Plugin/PrerenderManager.php
Constructs a new \Drupal\bootstrap\Plugin\PrerenderManager object.
ProcessManager::__construct in themes/contrib/bootstrap/src/Plugin/ProcessManager.php
Constructs a new \Drupal\bootstrap\Plugin\ProcessManager object.

... See full list

8 methods override PluginManager::__construct()
AlterManager::__construct in themes/contrib/bootstrap/src/Plugin/AlterManager.php
Constructs a new \Drupal\bootstrap\Plugin\AlterManager object.
FormManager::__construct in themes/contrib/bootstrap/src/Plugin/FormManager.php
Constructs a new \Drupal\bootstrap\Plugin\FormManager object.
PreprocessManager::__construct in themes/contrib/bootstrap/src/Plugin/PreprocessManager.php
Constructs a new \Drupal\bootstrap\Plugin\PreprocessManager object.
PrerenderManager::__construct in themes/contrib/bootstrap/src/Plugin/PrerenderManager.php
Constructs a new \Drupal\bootstrap\Plugin\PrerenderManager object.
ProcessManager::__construct in themes/contrib/bootstrap/src/Plugin/ProcessManager.php
Constructs a new \Drupal\bootstrap\Plugin\ProcessManager object.

... See full list

File

themes/contrib/bootstrap/src/Plugin/PluginManager.php, line 54
Contains \Drupal\bootstrap\Plugin\PluginManager.

Class

PluginManager
Base class for Bootstrap plugin managers.

Namespace

Drupal\bootstrap\Plugin

Code

public function __construct(Theme $theme, $subdir, $plugin_interface = NULL, $plugin_definition_annotation_name = 'Drupal\\Component\\Annotation\\Plugin') {

  // Get the active theme.
  $this->theme = $theme;

  // Determine the namespaces to search for.
  $namespaces = [];
  foreach ($theme
    ->getAncestry() as $ancestor) {
    $namespaces['Drupal\\' . $ancestor
      ->getName()] = [
      DRUPAL_ROOT . '/' . $ancestor
        ->getPath() . '/src',
    ];
  }
  $this->namespaces = new \ArrayObject($namespaces);
  $this->subdir = $subdir;
  $this->pluginDefinitionAnnotationName = $plugin_definition_annotation_name;
  $this->pluginInterface = $plugin_interface;
  $this->themeHandler = \Drupal::service('theme_handler');
  $this->themeManager = \Drupal::service('theme.manager');
}