You are here

public function GroupContentEnablerManager::getAll in Group 8

Returns a plugin collection of all available content enablers.

This collection will not have anything set in the individual plugins' configuration. Do not use any methods on the plugin that require a group type to be set or you may encounter unexpected behavior. Instead, use ::getInstalled() while providing a group type argument to get fully configured instances of the plugins.

Return value

\Drupal\group\Plugin\GroupContentEnablerCollection A plugin collection with a vanilla instance of every known plugin.

Overrides GroupContentEnablerManagerInterface::getAll

1 call to GroupContentEnablerManager::getAll()
GroupContentEnablerManager::getVanillaInstalled in src/Plugin/GroupContentEnablerManager.php
Retrieves a vanilla instance of every installed plugin.

File

src/Plugin/GroupContentEnablerManager.php, line 205

Class

GroupContentEnablerManager
Manages GroupContentEnabler plugin implementations.

Namespace

Drupal\group\Plugin

Code

public function getAll() {
  if (!isset($this->allPlugins)) {
    $collection = new GroupContentEnablerCollection($this, []);

    // Add every known plugin to the collection with a vanilla configuration.
    foreach ($this
      ->getDefinitions() as $plugin_id => $plugin_info) {
      $collection
        ->setInstanceConfiguration($plugin_id, [
        'id' => $plugin_id,
      ]);
    }

    // Sort and set the plugin collection.
    $this->allPlugins = $collection
      ->sort();
  }
  return $this->allPlugins;
}