3 namespace Drupal\Core\Entity\Annotation;
5 use Drupal\Component\Annotation\Plugin;
8 * Defines an EntityReferenceSelection plugin annotation object.
10 * Plugin Namespace: Plugin\EntityReferenceSelection
12 * For a working example, see
13 * \Drupal\comment\Plugin\EntityReferenceSelection\CommentSelection
15 * @see \Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginManager
16 * @see \Drupal\Core\Entity\EntityReferenceSelection\SelectionInterface
21 class EntityReferenceSelection extends Plugin {
31 * The human-readable name of the selection plugin.
33 * @ingroup plugin_translatable
35 * @var \Drupal\Core\Annotation\Translation
40 * The selection plugin group.
42 * This property is used to allow selection plugins to target a specific
43 * entity type while also inheriting the code of an existing selection plugin.
44 * For example, if we want to override the NodeSelection from the 'default'
45 * selection type, we can define the annotation of a new plugin as follows:
47 * id = "node_advanced",
48 * entity_types = {"node"},
58 * An array of entity types that can be referenced by this plugin. Defaults to
61 * @var array (optional)
63 public $entity_types = [];
66 * The weight of the plugin in it's group.