Block.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. namespace Drupal\Core\Block\Annotation;
  3. use Drupal\Component\Annotation\Plugin;
  4. /**
  5. * Defines a Block annotation object.
  6. *
  7. * @ingroup block_api
  8. *
  9. * @Annotation
  10. */
  11. class Block extends Plugin {
  12. /**
  13. * The plugin ID.
  14. *
  15. * @var string
  16. */
  17. public $id;
  18. /**
  19. * The administrative label of the block.
  20. *
  21. * @var \Drupal\Core\Annotation\Translation
  22. *
  23. * @ingroup plugin_translatable
  24. */
  25. public $admin_label = '';
  26. /**
  27. * The category in the admin UI where the block will be listed.
  28. *
  29. * @var \Drupal\Core\Annotation\Translation
  30. *
  31. * @ingroup plugin_translatable
  32. */
  33. public $category = '';
  34. /**
  35. * An array of context definitions describing the context used by the plugin.
  36. *
  37. * The array is keyed by context names.
  38. *
  39. * @var \Drupal\Core\Annotation\ContextDefinition[]
  40. *
  41. * @deprecated Providing context definitions via the "context" key is
  42. * deprecated in Drupal 8.7.x and will be removed before Drupal 9.0.0. Use
  43. * the "context_definitions" key instead.
  44. */
  45. public $context = [];
  46. /**
  47. * An array of context definitions describing the context used by the plugin.
  48. *
  49. * The array is keyed by context names.
  50. *
  51. * @var \Drupal\Core\Annotation\ContextDefinition[]
  52. */
  53. public $context_definitions = [];
  54. }