You are here

protected function DefaultLazyPluginCollection::initializePlugin in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php \Drupal\Core\Plugin\DefaultLazyPluginCollection::initializePlugin()
  2. 9 core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php \Drupal\Core\Plugin\DefaultLazyPluginCollection::initializePlugin()

File

core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php, line 76

Class

DefaultLazyPluginCollection
Provides a default plugin collection for a plugin type.

Namespace

Drupal\Core\Plugin

Code

protected function initializePlugin($instance_id) {
  $configuration = $this->configurations[$instance_id] ?? [];
  if (!isset($configuration[$this->pluginKey])) {
    throw new PluginNotFoundException($instance_id);
  }
  $this
    ->set($instance_id, $this->manager
    ->createInstance($configuration[$this->pluginKey], $configuration));
}