You are here

public function LazyPluginCollection::addInstanceId in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Component/Plugin/LazyPluginCollection.php \Drupal\Component\Plugin\LazyPluginCollection::addInstanceId()
  2. 9 core/lib/Drupal/Component/Plugin/LazyPluginCollection.php \Drupal\Component\Plugin\LazyPluginCollection::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.

File

core/lib/Drupal/Component/Plugin/LazyPluginCollection.php, line 118

Class

LazyPluginCollection
Defines an object which stores multiple plugin instances to lazy load them.

Namespace

Drupal\Component\Plugin

Code

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