You are here

public function GroupContentEnablerManager::getInstalledIds in Group 8

Returns the plugin ID of all content enablers 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 content enabler plugin IDs. If $group_type was provided, this will only return the installed IDs for that group type.

Overrides GroupContentEnablerManagerInterface::getInstalledIds

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

File

src/Plugin/GroupContentEnablerManager.php, line 295

Class

GroupContentEnablerManager
Manages GroupContentEnabler plugin implementations.

Namespace

Drupal\group\Plugin

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()] : [];
}