You are here

public function Key::getPluginCollection in Key 8

Create a plugin collection of the requested plugin type.

Parameters

string $type: The plugin type.

Return value

\Drupal\key\Plugin\KeyPluginCollection The plugin collection.

1 call to Key::getPluginCollection()
Key::getPluginCollections in src/Entity/Key.php
Gets the plugin collections used by this object.

File

src/Entity/Key.php, line 233

Class

Key
Defines the Key entity.

Namespace

Drupal\key\Entity

Code

public function getPluginCollection($type) {
  if (!isset($this->pluginCollections[$type . '_settings'])) {
    $this->pluginCollections[$type . '_settings'] = new KeyPluginCollection(\Drupal::service("plugin.manager.key.{$type}"), $this
      ->get($type), $this
      ->get($type . '_settings'));
  }
  return $this->pluginCollections[$type . '_settings'];
}