You are here

public function LazyPluginCollection::set in Plug 7

Stores an initialized plugin.

Parameters

string $instance_id: The ID of the plugin instance being stored.

mixed $value: An instantiated plugin.

1 call to LazyPluginCollection::set()
DefaultLazyPluginCollection::initializePlugin in lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php
Initializes and stores a plugin.

File

lib/Drupal/Component/Plugin/LazyPluginCollection.php, line 98
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 set($instance_id, $value) {
  $this->pluginInstances[$instance_id] = $value;
  $this
    ->addInstanceId($instance_id);
}