You are here

public function RecipientTypePluginCollection::getAll in Workbench Email 8

Same name and namespace in other branches
  1. 2.x src/RecipientTypePluginCollection.php \Drupal\workbench_email\RecipientTypePluginCollection::getAll()

Retrieves plugin definitions and creates an instance for each.

1 call to RecipientTypePluginCollection::getAll()
RecipientTypePluginCollection::sort in src/RecipientTypePluginCollection.php
Sorts all plugin instances in this collection.

File

src/RecipientTypePluginCollection.php, line 33

Class

RecipientTypePluginCollection
A collection of recipient types.

Namespace

Drupal\workbench_email

Code

public function getAll() {

  // Retrieve all available behavior plugin definitions.
  if (!$this->definitions) {
    $this->definitions = $this->manager
      ->getDefinitions();
  }

  // Ensure that there is an instance of all available behavior plugins.
  foreach ($this->definitions as $plugin_id => $definition) {
    if (!isset($this->pluginInstances[$plugin_id])) {
      $this
        ->initializePlugin($plugin_id);
    }
  }
  return $this->pluginInstances;
}