You are here

public function DefaultLazyPluginCollection::addInstanceId in Drupal 9

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

Adds an instance ID to the available instance IDs.

Parameters

string $id: The ID of the plugin instance to add.

array|null $configuration: (optional) The configuration used by this instance. Defaults to NULL.

Overrides LazyPluginCollection::addInstanceId

File

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

Class

DefaultLazyPluginCollection
Provides a default plugin collection for a plugin type.

Namespace

Drupal\Core\Plugin

Code

public function addInstanceId($id, $configuration = NULL) {
  parent::addInstanceId($id);
  if ($configuration !== NULL) {
    $this
      ->setInstanceConfiguration($id, $configuration);
  }
  if (!isset($this->originalOrder[$id])) {
    $this->originalOrder[$id] = $id;
  }
}