You are here

public function GroupContentEnablerManager::getPluginGroupContentTypeMap in Group 8

Retrieves a list of group content type IDs per plugin ID.

Return value

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

Overrides GroupContentEnablerManagerInterface::getPluginGroupContentTypeMap

2 calls to GroupContentEnablerManager::getPluginGroupContentTypeMap()
GroupContentEnablerManager::getGroupContentTypeIds in src/Plugin/GroupContentEnablerManager.php
Retrieves all of the group content type IDs for a content plugin.
GroupContentEnablerManager::getInstalledIds in src/Plugin/GroupContentEnablerManager.php
Returns the plugin ID of all content enablers in use.

File

src/Plugin/GroupContentEnablerManager.php, line 360

Class

GroupContentEnablerManager
Manages GroupContentEnabler plugin implementations.

Namespace

Drupal\group\Plugin

Code

public function getPluginGroupContentTypeMap() {
  $map = $this
    ->getCachedPluginGroupContentTypeMap();
  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
        ->getContentPluginId()][] = $group_content_type
        ->id();
    }
    $this
      ->setCachedPluginGroupContentTypeMap($map);
  }
  return $map;
}