Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. SelectionPluginManager.php

function SelectionPluginManager::getPluginId

Overrides SelectionPluginManagerInterface::getPluginId

1 call to SelectionPluginManager::getPluginId()
SelectionPluginManager::getInstance in core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionPluginManager.php

File

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

Class

SelectionPluginManager
Plugin type manager for Entity Reference Selection plugins.

Namespace

Drupal\Core\Entity\EntityReferenceSelection

Code

public function getPluginId($target_type, $base_plugin_id) {
    // Get all available selection plugins for this entity type.
    $selection_handler_groups = $this->getSelectionGroups($target_type);
    // Sort the selection plugins by weight and select the best match.
    uasort($selection_handler_groups[$base_plugin_id], [
        'Drupal\\Component\\Utility\\SortArray',
        'sortByWeightElement',
    ]);
    $plugin_id = array_key_last($selection_handler_groups[$base_plugin_id]);
    return $plugin_id;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal