You are here

public function LazyPluginCollection::get in Plug 7

Gets a plugin instance, initializing it if necessary.

Parameters

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

3 calls to LazyPluginCollection::get()
DefaultLazyPluginCollection::setInstanceConfiguration in lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php
Updates the configuration for a plugin instance.
DefaultLazyPluginCollection::sortHelper in lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php
Provides uasort() callback to sort plugins.
LazyPluginCollection::getIterator in lib/Drupal/Component/Plugin/LazyPluginCollection.php

File

lib/Drupal/Component/Plugin/LazyPluginCollection.php, line 83
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 &get($instance_id) {
  if (!isset($this->pluginInstances[$instance_id])) {
    $this
      ->initializePlugin($instance_id);
  }
  return $this->pluginInstances[$instance_id];
}