protected function BackendPluginCollection::initializePlugin in Advanced Queue 8
Initializes and stores a plugin.
Parameters
string $instance_id: The ID of the plugin instance to initialize.
Overrides DefaultSingleLazyPluginCollection::initializePlugin
File
- src/
BackendPluginCollection.php, line 43
Class
- BackendPluginCollection
- Stores a single backend plugin, aware of its parent entity ID.
Namespace
Drupal\advancedqueueCode
protected function initializePlugin($instance_id) {
if (!$instance_id) {
throw new PluginException("The queue '{$this->entityId}' did not specify a plugin.");
}
$configuration = [
'_entity_id' => $this->entityId,
] + $this->configuration;
$plugin = $this->manager
->createInstance($instance_id, $configuration);
$this
->set($instance_id, $plugin);
}