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\EntityReferenceSelectionCode
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;
}