Action.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. namespace Drupal\Core\Annotation;
  3. use Drupal\Component\Annotation\Plugin;
  4. /**
  5. * Defines an Action annotation object.
  6. *
  7. * Plugin Namespace: Plugin\Action
  8. *
  9. * For a working example, see \Drupal\node\Plugin\Action\UnpublishNode
  10. *
  11. * @see \Drupal\Core\Action\ActionInterface
  12. * @see \Drupal\Core\Action\ActionManager
  13. * @see \Drupal\Core\Action\ActionBase
  14. * @see plugin_api
  15. *
  16. * @Annotation
  17. */
  18. class Action extends Plugin {
  19. /**
  20. * The plugin ID.
  21. *
  22. * @var string
  23. */
  24. public $id;
  25. /**
  26. * The human-readable name of the action plugin.
  27. *
  28. * @ingroup plugin_translatable
  29. *
  30. * @var \Drupal\Core\Annotation\Translation
  31. */
  32. public $label;
  33. /**
  34. * The route name for a confirmation form for this action.
  35. *
  36. * @todo Provide a more generic way to allow an action to be confirmed first.
  37. *
  38. * @var string (optional)
  39. */
  40. public $confirm_form_route_name = '';
  41. /**
  42. * The entity type the action can apply to.
  43. *
  44. * @todo Replace with \Drupal\Core\Plugin\Context\Context.
  45. *
  46. * @var string
  47. */
  48. public $type = '';
  49. /**
  50. * The category under which the action should be listed in the UI.
  51. *
  52. * @var \Drupal\Core\Annotation\Translation
  53. *
  54. * @ingroup plugin_translatable
  55. */
  56. public $category;
  57. }