Newer
Older
Alex Pott
committed
<?php
Alex Pott
committed
namespace Drupal\Core\Entity\Annotation;
Alex Pott
committed
use Drupal\Component\Annotation\Plugin;
/**
Jennifer Hodgdon
committed
* Defines an EntityReferenceSelection plugin annotation object.
*
Alex Pott
committed
* Plugin Namespace: Plugin\EntityReferenceSelection
Jennifer Hodgdon
committed
*
* For a working example, see
Alex Pott
committed
* \Drupal\comment\Plugin\EntityReferenceSelection\CommentSelection
Jennifer Hodgdon
committed
*
Alex Pott
committed
* @see \Drupal\Core\Entity\EntityReferenceSelection\SelectionPluginManager
* @see \Drupal\Core\Entity\EntityReferenceSelection\SelectionInterface
Jennifer Hodgdon
committed
* @see plugin_api
Alex Pott
committed
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
*
* @Annotation
*/
class EntityReferenceSelection extends Plugin {
/**
* The plugin ID.
*
* @var string
*/
public $id;
/**
* The human-readable name of the selection plugin.
*
* @ingroup plugin_translatable
*
* @var \Drupal\Core\Annotation\Translation
*/
public $label;
/**
* The selection plugin group.
*
* This property is used to allow selection plugins to target a specific
* entity type while also inheriting the code of an existing selection plugin.
* For example, if we want to override the NodeSelection from the 'default'
* selection type, we can define the annotation of a new plugin as follows:
* @code
* id = "node_advanced",
* entity_types = {"node"},
* group = "default",
* weight = 5
* @endcode
*
* @var string
*/
public $group;
/**
* An array of entity types that can be referenced by this plugin. Defaults to
* all entity types.
*
* @var array (optional)
*/
public $entity_types = [];
Alex Pott
committed
/**
* The weight of the plugin in its group.