You are here

public function GroupRelationManager::getGroupTypePluginMap in Group 2.0.x

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 GroupRelationManagerInterface::getGroupTypePluginMap

1 call to GroupRelationManager::getGroupTypePluginMap()
GroupRelationManager::getInstalledIds in src/Plugin/Group/Relation/GroupRelationManager.php
Returns the plugin ID of all group relations in use.

File

src/Plugin/Group/Relation/GroupRelationManager.php, line 402

Class

GroupRelationManager
Manages GroupRelation plugin implementations.

Namespace

Drupal\group\Plugin\Group\Relation

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
        ->getRelationPluginId();
    }
    $this
      ->setCachedGroupTypePluginMap($map);
  }
  return $map;
}