function SelectionPluginManager::getSelectionGroups

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionPluginManager.php \Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginManager::getSelectionGroups()
  2. 10 core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionPluginManager.php \Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginManager::getSelectionGroups()
  3. 11.x core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionPluginManager.php \Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginManager::getSelectionGroups()

Overrides SelectionPluginManagerInterface::getSelectionGroups

1 call to SelectionPluginManager::getSelectionGroups()
SelectionPluginManager::getPluginId in core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionPluginManager.php
Gets the plugin ID for a given target entity type and base plugin ID.

File

core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionPluginManager.php, line 75

Class

SelectionPluginManager
Plugin type manager for Entity Reference Selection plugins.

Namespace

Drupal\Core\Entity\EntityReferenceSelection

Code

public function getSelectionGroups($entity_type_id) {
    $plugins = [];
    $definitions = $this->getDefinitions();
    // Do not display the 'broken' plugin in the UI.
    unset($definitions['broken']);
    foreach ($definitions as $plugin_id => $plugin) {
        if (empty($plugin['entity_types']) || in_array($entity_type_id, $plugin['entity_types'])) {
            $plugins[$plugin['group']][$plugin_id] = $plugin;
        }
    }
    return $plugins;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.