interface SelectionPluginManagerInterface

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionPluginManagerInterface.php \Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginManagerInterface
  2. 8.9.x core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionPluginManagerInterface.php \Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginManagerInterface
  3. 10 core/lib/Drupal/Core/Entity/EntityReferenceSelection/SelectionPluginManagerInterface.php \Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginManagerInterface

Defines an interface for the entity reference selection plugin manager.

Hierarchy

  • interface \Drupal\Component\Plugin\Discovery\DiscoveryInterface; interface \Drupal\Component\Plugin\Factory\FactoryInterface; interface \Drupal\Component\Plugin\Mapper\MapperInterface
    • interface \Drupal\Component\Plugin\PluginManagerInterface extends \Drupal\Component\Plugin\Discovery\DiscoveryInterface \Drupal\Component\Plugin\Factory\FactoryInterface \Drupal\Component\Plugin\Mapper\MapperInterface

Expanded class hierarchy of SelectionPluginManagerInterface

All classes that implement SelectionPluginManagerInterface

3 files declare their use of SelectionPluginManagerInterface
EntityAutocompleteMatcher.php in core/lib/Drupal/Core/Entity/EntityAutocompleteMatcher.php
EntityReference.php in core/modules/views/src/Plugin/views/filter/EntityReference.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

Title Sort descending Modifiers Object type Summary Overrides
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

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