manager = $manager; $this->instanceId = $instance_id; // This is still needed by the parent LazyPluginCollection class. $this->instanceIDs = [$instance_id => $instance_id]; $this->configuration = $configuration; } /** * {@inheritdoc} */ protected function initializePlugin($instance_id) { $this->set($instance_id, $this->manager->createInstance($instance_id, $this->configuration)); } /** * {@inheritdoc} */ public function getConfiguration() { $plugin = $this->get($this->instanceId); if ($plugin instanceof ConfigurablePluginInterface) { return $plugin->getConfiguration(); } else { return $this->configuration; } } /** * {@inheritdoc} */ public function setConfiguration($configuration) { $this->configuration = $configuration; $plugin = $this->get($this->instanceId); if ($plugin instanceof ConfigurablePluginInterface) { $plugin->setConfiguration($configuration); } return $this; } /** * {@inheritdoc} */ public function addInstanceId($id, $configuration = NULL) { $this->instanceId = $id; parent::addInstanceId($id, $configuration); if ($configuration !== NULL) { $this->setConfiguration($configuration); } } }