You are here

public function LazyPluginCollection::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.

2 calls to LazyPluginCollection::addInstanceId()
DefaultLazyPluginCollection::addInstanceId in lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php
Adds an instance ID to the available instance IDs.
LazyPluginCollection::set in lib/Drupal/Component/Plugin/LazyPluginCollection.php
Stores an initialized plugin.
1 method overrides LazyPluginCollection::addInstanceId()
DefaultLazyPluginCollection::addInstanceId in lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php
Adds an instance ID to the available instance IDs.

File

lib/Drupal/Component/Plugin/LazyPluginCollection.php, line 123
Contains \Drupal\Component\Plugin\LazyPluginCollection.

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