DomainAdminSelection.php 973 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace Drupal\domain\Plugin\EntityReferenceSelection;
  3. /**
  4. * Provides entity reference selections for the domain entity type.
  5. *
  6. * @EntityReferenceSelection(
  7. * id = "domain:domain",
  8. * label = @Translation("Domain administrator selection"),
  9. * base_plugin_label = @Translation("Domain administrator"),
  10. * entity_types = {"domain"},
  11. * group = "domain",
  12. * weight = 5
  13. * )
  14. */
  15. class DomainAdminSelection extends DomainSelection {
  16. /**
  17. * Sets the context for the alter hook.
  18. *
  19. * The only difference between this selector and its parent are the
  20. * permissions used to restrict access. Since the field information is not
  21. * available through the DefaultSelector class, we have to coerce that
  22. * information to pass it to our hook.
  23. *
  24. * We could do this by reading the id from the annotation, but setting an
  25. * explicit variable seems more obvious for developers.
  26. *
  27. * @var string
  28. */
  29. protected $fieldType = 'admin';
  30. }