You are here

public function GroupContentEnablerManager::getGroupTypePluginMap in Group 8

Retrieves a list of plugin IDs per group type ID.

Return value

array An array of content plugin ID arrays, keyed by group type ID.

Overrides GroupContentEnablerManagerInterface::getGroupTypePluginMap

1 call to GroupContentEnablerManager::getGroupTypePluginMap()
GroupContentEnablerManager::getInstalledIds in src/Plugin/GroupContentEnablerManager.php
Returns the plugin ID of all content enablers in use.

File

src/Plugin/GroupContentEnablerManager.php, line 407

Class

GroupContentEnablerManager
Manages GroupContentEnabler plugin implementations.

Namespace

Drupal\group\Plugin

Code

public function getGroupTypePluginMap() {
  $map = $this
    ->getCachedGroupTypePluginMap();
  if (!isset($map)) {
    $map = [];

    /** @var \Drupal\group\Entity\GroupContentTypeInterface[] $group_content_types */
    $group_content_types = $this
      ->getGroupContentTypeStorage()
      ->loadMultiple();
    foreach ($group_content_types as $group_content_type) {
      $map[$group_content_type
        ->getGroupTypeId()][] = $group_content_type
        ->getContentPluginId();
    }
    $this
      ->setCachedGroupTypePluginMap($map);
  }
  return $map;
}