function SelectionPluginManager::getPluginId
Gets the plugin ID for a given target entity type and base plugin ID.
Parameters
string $target_type: The target entity type.
string $base_plugin_id: The base plugin ID (e.g. 'default' or 'views').
Return value
string The plugin ID.
Overrides SelectionPluginManagerInterface::getPluginId
1 call to SelectionPluginManager::getPluginId()
- SelectionPluginManager::getInstance in core/
lib/ Drupal/ Core/ Entity/ EntityReferenceSelection/ SelectionPluginManager.php  - Gets a preconfigured instance of a plugin.
 
File
- 
              core/
lib/ Drupal/ Core/ Entity/ EntityReferenceSelection/ SelectionPluginManager.php, line 60  
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',
  ]);
  end($selection_handler_groups[$base_plugin_id]);
  $plugin_id = key($selection_handler_groups[$base_plugin_id]);
  return $plugin_id;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.