function TestLazyPluginCollection::__construct

Same name in other branches
  1. 9 core/modules/system/tests/modules/plugin_test/src/Plugin/TestLazyPluginCollection.php \Drupal\plugin_test\Plugin\TestLazyPluginCollection::__construct()
  2. 8.9.x core/modules/system/tests/modules/plugin_test/src/Plugin/TestLazyPluginCollection.php \Drupal\plugin_test\Plugin\TestLazyPluginCollection::__construct()
  3. 10 core/modules/system/tests/modules/plugin_test/src/Plugin/TestLazyPluginCollection.php \Drupal\plugin_test\Plugin\TestLazyPluginCollection::__construct()

Constructs a TestLazyPluginCollection object.

Parameters

\Drupal\Component\Plugin\PluginManagerInterface $manager: The plugin manager that handles test plugins.

File

core/modules/system/tests/modules/plugin_test/src/Plugin/TestLazyPluginCollection.php, line 28

Class

TestLazyPluginCollection
Defines a plugin collection which uses fruit plugins.

Namespace

Drupal\plugin_test\Plugin

Code

public function __construct(PluginManagerInterface $manager) {
    $this->manager = $manager;
    $instance_ids = array_keys($this->manager
        ->getDefinitions());
    $this->instanceIds = array_combine($instance_ids, $instance_ids);
}

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