You are here

public function DefaultLazyPluginCollection::addInstanceId in Plug 7

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

lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php, line 172
Contains \Drupal\Core\Plugin\DefaultLazyPluginCollection.

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;
  }
}