You are here

interface SelectionPluginManagerInterface in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionPluginManagerInterface.php \Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginManagerInterface

Defines an interface for the entity reference selection plugin manager.

Hierarchy

Expanded class hierarchy of SelectionPluginManagerInterface

All classes that implement SelectionPluginManagerInterface

2 files declare their use of SelectionPluginManagerInterface
EntityAutocompleteMatcher.php in core/lib/Drupal/Core/Entity/EntityAutocompleteMatcher.php
ValidReferenceConstraintValidator.php in core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/ValidReferenceConstraintValidator.php

File

core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionPluginManagerInterface.php, line 12

Namespace

Drupal\Core\Entity\EntityReferenceSelection
View source
interface SelectionPluginManagerInterface extends PluginManagerInterface {

  /**
   * Gets the plugin ID for a given target entity type and base plugin ID.
   *
   * @param string $target_type
   *   The target entity type.
   * @param string $base_plugin_id
   *   The base plugin ID (e.g. 'default' or 'views').
   *
   * @return string
   *   The plugin ID.
   */
  public function getPluginId($target_type, $base_plugin_id);

  /**
   * Gets the selection plugins that can reference a specific entity type.
   *
   * @param string $entity_type_id
   *   A Drupal entity type ID.
   *
   * @return array
   *   An array of selection plugins grouped by selection group.
   */
  public function getSelectionGroups($entity_type_id);

  /**
   * Gets the selection handler for a given entity_reference field.
   *
   * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
   *   The field definition for the operation.
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   (optional) The entity for the operation. Defaults to NULL.
   *
   * @return \Drupal\Core\Entity\EntityReferenceSelection\SelectionInterface
   *   The selection plugin.
   */
  public function getSelectionHandler(FieldDefinitionInterface $field_definition, EntityInterface $entity = NULL);

}

Members

Namesort descending Modifiers Type Description Overrides
DiscoveryInterface::getDefinition public function Gets a specific plugin definition. 4
DiscoveryInterface::getDefinitions public function Gets the definition of all plugins for this type. 3
DiscoveryInterface::hasDefinition public function Indicates if a specific plugin definition exists. 1
FactoryInterface::createInstance public function Creates a pre-configured instance of a plugin. 6
MapperInterface::getInstance public function Gets a preconfigured instance of a plugin. 3
SelectionPluginManagerInterface::getPluginId public function Gets the plugin ID for a given target entity type and base plugin ID. 1
SelectionPluginManagerInterface::getSelectionGroups public function Gets the selection plugins that can reference a specific entity type. 1
SelectionPluginManagerInterface::getSelectionHandler public function Gets the selection handler for a given entity_reference field. 1