function DefaultLazyPluginCollection::__construct

Same name in other branches
  1. 9 core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php \Drupal\Core\Plugin\DefaultLazyPluginCollection::__construct()
  2. 8.9.x core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php \Drupal\Core\Plugin\DefaultLazyPluginCollection::__construct()
  3. 11.x core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php \Drupal\Core\Plugin\DefaultLazyPluginCollection::__construct()

Constructs a new DefaultLazyPluginCollection object.

Parameters

\Drupal\Component\Plugin\PluginManagerInterface $manager: The manager to be used for instantiating plugins.

array $configurations: (optional) An associative array containing the initial configuration for each plugin in the collection, keyed by plugin instance ID.

1 call to DefaultLazyPluginCollection::__construct()
DisplayPluginCollection::__construct in core/modules/views/src/DisplayPluginCollection.php
Constructs a DisplayPluginCollection object.
1 method overrides DefaultLazyPluginCollection::__construct()
DisplayPluginCollection::__construct in core/modules/views/src/DisplayPluginCollection.php
Constructs a DisplayPluginCollection object.

File

core/lib/Drupal/Core/Plugin/DefaultLazyPluginCollection.php, line 61

Class

DefaultLazyPluginCollection
Provides a default plugin collection for a plugin type.

Namespace

Drupal\Core\Plugin

Code

public function __construct(PluginManagerInterface $manager, array $configurations = []) {
    $this->manager = $manager;
    $this->configurations = $configurations;
    if (!empty($configurations)) {
        $instance_ids = array_keys($configurations);
        $this->instanceIds = array_combine($instance_ids, $instance_ids);
        // Store the original order of the instance IDs for export.
        $this->originalOrder = $this->instanceIds;
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.