ReinstallEvents.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. namespace Drupal\reinstall;
  3. /**
  4. * Defines events for the Dumper system.
  5. *
  6. * @see \Drupal\reinstall\Dumper
  7. */
  8. final class ReinstallEvents {
  9. /**
  10. * Name of the event fired when entities have been dumped.
  11. *
  12. * This event allows modules to perform an action whenever content entities
  13. * of a given entity type bundle are exported, usually to perform extra
  14. * operations, like:
  15. * - copying/moving the actual files on file export.
  16. *
  17. * The event listener method receives a \Drupal\reinstall\SerializeEvent
  18. * instance, carrying an array of all entites indexed by $entity->id().
  19. *
  20. * Note that this assumes entity types with an ID, which is not stricly
  21. * required by the Entity API, but common enough for most needs.
  22. *
  23. * @Event
  24. *
  25. * @var string
  26. */
  27. const POST_DUMP = 'reinstall.dump.post';
  28. /**
  29. * Name of the event fired when readying entities for dump.
  30. *
  31. * This event allows modules to perform an action whenever content entities
  32. * of a given entity type bundle are exported, usually to add data to the
  33. * export, like:
  34. * - parent on taxonomy_term.
  35. * - path on any entity with a canonical path.
  36. *
  37. * The event listener method receives a \Drupal\reinstall\DumperEvent
  38. * instance, carrying an array of all entites indexed by $entity->id().
  39. *
  40. * Note that this assumes entity types with an ID, which is not stricly
  41. * required by the Entity API, but common enough for most needs.
  42. *
  43. * @Event
  44. *
  45. * @var string
  46. */
  47. const PRE_DUMP = 'reinstall.dump.pre';
  48. const POST_SOURCE_PARSE = 'reinstall.source_parse.post';
  49. }