Overrides \Drupal\Component\Plugin\PluginBag::initializePlugin().
Overrides PluginBag::initializePlugin
protected function initializePlugin($instance_id) {
// If the tip was initialized before, just return.
if (isset($this->pluginInstances[$instance_id])) {
return;
}
$type = $this->configurations[$instance_id]['plugin'];
$definition = $this->manager
->getDefinition($type);
if (isset($definition)) {
$this
->addInstanceID($instance_id);
$configuration = $definition;
// Merge the actual configuration into the default configuration.
if (isset($this->configurations[$instance_id])) {
$configuration = NestedArray::mergeDeep($configuration, $this->configurations[$instance_id]);
}
$this->pluginInstances[$instance_id] = $this->manager
->createInstance($type, $configuration);
}
else {
throw new PluginException(format_string("Unknown tip plugin ID '@tip'.", array(
'@tip' => $instance_id,
)));
}
}