You are here

public function UpdateManager::__construct in Express 8

Constructs a new \Drupal\bootstrap\Plugin\UpdateManager object.

Parameters

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

Overrides PluginManager::__construct

File

themes/contrib/bootstrap/src/Plugin/UpdateManager.php, line 25
Contains \Drupal\bootstrap\Plugin\UpdateManager.

Class

UpdateManager
Manages discovery and instantiation of Bootstrap updates.

Namespace

Drupal\bootstrap\Plugin

Code

public function __construct(Theme $theme) {

  // Unlike other plugins in this base theme, this one should only discover
  // update plugins that are unique to its own theme to avoid plugin ID
  // collision (e.g. base and sub-theme both implement an update plugin
  // with the id "8001").
  $this->namespaces = new \ArrayObject([
    'Drupal\\' . $theme
      ->getName() => [
      DRUPAL_ROOT . '/' . $theme
        ->getPath() . '/src',
    ],
  ]);
  $this->theme = $theme;
  $this->subdir = 'Plugin/Update';
  $this->pluginDefinitionAnnotationName = 'Drupal\\bootstrap\\Annotation\\BootstrapUpdate';
  $this->pluginInterface = 'Drupal\\bootstrap\\Plugin\\Update\\UpdateInterface';
  $this->themeHandler = \Drupal::service('theme_handler');
  $this->themeManager = \Drupal::service('theme.manager');
  $this
    ->setCacheBackend(\Drupal::cache('discovery'), 'theme:' . $theme
    ->getName() . ':update', $this
    ->getCacheTags());
}