public function PluginBag::get

Retrieves a plugin instance, initializing it if necessary.

Parameters

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

2 calls to PluginBag::get()
FilterBag::sortHelper in drupal/core/modules/filter/lib/Drupal/filter/FilterBag.php
uasort() callback to sort filters by status, weight, module, and name.
PluginBag::current in drupal/core/lib/Drupal/Component/Plugin/PluginBag.php
Implements \Iterator::current().

File

drupal/core/lib/Drupal/Component/Plugin/PluginBag.php, line 66
Contains \Drupal\Component\Plugin\PluginBag.

Class

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