You are here

public function LazyPluginCollection::get in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Component/Plugin/LazyPluginCollection.php \Drupal\Component\Plugin\LazyPluginCollection::get()
  2. 10 core/lib/Drupal/Component/Plugin/LazyPluginCollection.php \Drupal\Component\Plugin\LazyPluginCollection::get()

Gets a plugin instance, initializing it if necessary.

Parameters

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

13 calls to LazyPluginCollection::get()
ActionPluginCollection::get in core/lib/Drupal/Core/Action/ActionPluginCollection.php
BlockPluginCollection::get in core/modules/block/src/BlockPluginCollection.php
ConditionPluginCollection::get in core/lib/Drupal/Core/Condition/ConditionPluginCollection.php
DefaultLazyPluginCollection::setInstanceConfiguration in core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php
Updates the configuration for a plugin instance.
DefaultLazyPluginCollection::sortHelper in core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php
Provides uasort() callback to sort plugins.

... See full list

8 methods override LazyPluginCollection::get()
ActionPluginCollection::get in core/lib/Drupal/Core/Action/ActionPluginCollection.php
BlockPluginCollection::get in core/modules/block/src/BlockPluginCollection.php
ConditionPluginCollection::get in core/lib/Drupal/Core/Condition/ConditionPluginCollection.php
DisplayPluginCollection::get in core/modules/views/src/DisplayPluginCollection.php
FilterPluginCollection::get in core/modules/filter/src/FilterPluginCollection.php

... See full list

File

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

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