EntityTypeEvents.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. namespace Drupal\Core\Entity;
  3. /**
  4. * Contains all events thrown while handling entity types.
  5. */
  6. final class EntityTypeEvents {
  7. /**
  8. * The name of the event triggered when a new entity type is created.
  9. *
  10. * This event allows modules to react to a new entity type being created. The
  11. * event listener method receives a \Drupal\Core\Entity\EntityTypeEvent
  12. * instance.
  13. *
  14. * @Event
  15. *
  16. * @see \Drupal\Core\Entity\EntityTypeEvent
  17. * @see \Drupal\Core\Entity\EntityManager::onEntityTypeCreate()
  18. * @see \Drupal\Core\Entity\EntityTypeEventSubscriberTrait
  19. * @see \Drupal\views\EventSubscriber\ViewsEntitySchemaSubscriber::onEntityTypeCreate()
  20. *
  21. * @var string
  22. */
  23. const CREATE = 'entity_type.definition.create';
  24. /**
  25. * The name of the event triggered when an existing entity type is updated.
  26. *
  27. * This event allows modules to react whenever an existing entity type is
  28. * updated. The event listener method receives a
  29. * \Drupal\Core\Entity\EntityTypeEvent instance.
  30. *
  31. * @Event
  32. *
  33. * @see \Drupal\Core\Entity\EntityTypeEvent
  34. * @see \Drupal\Core\Entity\EntityManager::onEntityTypeUpdate()
  35. * @see \Drupal\Core\Entity\EntityTypeEventSubscriberTrait
  36. * @see \Drupal\views\EventSubscriber\ViewsEntitySchemaSubscriber::onEntityTypeUpdate()
  37. *
  38. * @var string
  39. */
  40. const UPDATE = 'entity_type.definition.update';
  41. /**
  42. * The name of the event triggered when an existing entity type is deleted.
  43. *
  44. * This event allows modules to react whenever an existing entity type is
  45. * deleted. The event listener method receives a
  46. * \Drupal\Core\Entity\EntityTypeEvent instance.
  47. *
  48. * @Event
  49. *
  50. * @see \Drupal\Core\Entity\EntityTypeEvent
  51. * @see \Drupal\Core\Entity\EntityManager::onEntityTypeDelete()
  52. * @see \Drupal\Core\Entity\EntityTypeEventSubscriberTrait
  53. * @see \Drupal\views\EventSubscriber\ViewsEntitySchemaSubscriber::onEntityTypeDelete()
  54. *
  55. * @var string
  56. */
  57. const DELETE = 'entity_type.definition.delete';
  58. }