You are here

public function GroupRelationManager::getInstalledIds in Group 2.0.x

Returns the plugin ID of all group relations in use.

Parameters

\Drupal\group\Entity\GroupTypeInterface $group_type: (optional) The group type to retrieve plugin IDs for.

Return value

string[] A list of all installed group relation plugin IDs. If $group_type was provided, this will only return the installed IDs for that group type.

Overrides GroupRelationManagerInterface::getInstalledIds

2 calls to GroupRelationManager::getInstalledIds()
GroupRelationManager::getVanillaInstalled in src/Plugin/Group/Relation/GroupRelationManager.php
Retrieves a vanilla instance of every installed plugin.
GroupRelationManager::installEnforced in src/Plugin/Group/Relation/GroupRelationManager.php
Installs all plugins which are marked as enforced.

File

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

Class

GroupRelationManager
Manages GroupRelation plugin implementations.

Namespace

Drupal\group\Plugin\Group\Relation

Code

public function getInstalledIds(GroupTypeInterface $group_type = NULL) {

  // If no group type was provided, we can find all installed plugin IDs by
  // grabbing the keys from the group content type IDs per plugin ID map.
  if (!isset($group_type)) {
    return array_keys($this
      ->getPluginGroupContentTypeMap());
  }

  // Otherwise, we can find the entry in the plugin IDs per group type ID map.
  $map = $this
    ->getGroupTypePluginMap();
  return isset($map[$group_type
    ->id()]) ? $map[$group_type
    ->id()] : [];
}