3 namespace Drupal\Core\Entity\EntityReferenceSelection;
5 use Drupal\Core\Database\Query\SelectInterface;
6 use Drupal\Core\Plugin\PluginFormInterface;
9 * Interface definition for Entity Reference Selection plugins.
11 * @see \Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginManager
12 * @see \Drupal\Core\Entity\Annotation\EntityReferenceSelection
15 interface SelectionInterface extends PluginFormInterface {
18 * Gets the list of referenceable entities.
21 * A nested array of entities, the first level is keyed by the
22 * entity bundle, which contains an array of entity labels (escaped),
23 * keyed by the entity ID.
25 public function getReferenceableEntities($match = NULL, $match_operator = 'CONTAINS', $limit = 0);
28 * Counts entities that are referenceable.
31 * The number of referenceable entities.
33 public function countReferenceableEntities($match = NULL, $match_operator = 'CONTAINS');
36 * Validates which existing entities can be referenced.
39 * An array of valid entity IDs.
41 public function validateReferenceableEntities(array $ids);
44 * Allows the selection to alter the SelectQuery generated by EntityFieldQuery.
46 * @param \Drupal\Core\Database\Query\SelectInterface $query
47 * A Select Query object.
49 public function entityQueryAlter(SelectInterface $query);