PluginID.php 597 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace Drupal\Component\Annotation;
  3. /**
  4. * Defines a Plugin annotation object that just contains an ID.
  5. *
  6. * @Annotation
  7. */
  8. class PluginID extends AnnotationBase {
  9. /**
  10. * The plugin ID.
  11. *
  12. * When an annotation is given no key, 'value' is assumed by Doctrine.
  13. *
  14. * @var string
  15. */
  16. public $value;
  17. /**
  18. * {@inheritdoc}
  19. */
  20. public function get() {
  21. return [
  22. 'id' => $this->value,
  23. 'class' => $this->class,
  24. 'provider' => $this->provider,
  25. ];
  26. }
  27. /**
  28. * {@inheritdoc}
  29. */
  30. public function getId() {
  31. return $this->value;
  32. }
  33. }