protected function DefaultLazyPluginCollection::initializePlugin in Plug 7
Initializes and stores a plugin.
Parameters
string $instance_id: The ID of the plugin instance to initialize.
Overrides LazyPluginCollection::initializePlugin
File
- lib/
Drupal/ Core/ Plugin/ DefaultLazyPluginCollection.php, line 79 - Contains \Drupal\Core\Plugin\DefaultLazyPluginCollection.
Class
- DefaultLazyPluginCollection
- Provides a default plugin collection for a plugin type.
Namespace
Drupal\Core\PluginCode
protected function initializePlugin($instance_id) {
$configuration = isset($this->configurations[$instance_id]) ? $this->configurations[$instance_id] : array();
if (!isset($configuration[$this->pluginKey])) {
throw new PluginNotFoundException($instance_id);
}
$this
->set($instance_id, $this->manager
->createInstance($configuration[$this->pluginKey], $configuration));
}