function public function UpdateManager::__construct

8.x-3.x UpdateManager.php public UpdateManager::__construct(Theme $theme)

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

Parameters

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

Overrides PluginManager::__construct

Class

UpdateManager
Manages discovery and instantiation of Bootstrap updates.

Namespace

Drupal\bootstrap\Plugin

Source src/Plugin/UpdateManager.php (line 21)

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());
}