1. 8.2.x core/lib/Drupal/Core/Entity/Annotation/EntityReferenceSelection.php
  2. 8.0.x core/lib/Drupal/Core/Entity/Annotation/EntityReferenceSelection.php
  3. 8.1.x core/lib/Drupal/Core/Entity/Annotation/EntityReferenceSelection.php
  4. 8.3.x core/lib/Drupal/Core/Entity/Annotation/EntityReferenceSelection.php

Namespace

Drupal\Core\Entity\Annotation

File

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

Classes

Namesort descending Description
EntityReferenceSelection Defines an EntityReferenceSelection plugin annotation object.