DumperEvent.php 941 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace Drupal\reinstall;
  3. use Drupal\Core\Entity\EntityStorageInterface;
  4. use Symfony\Component\EventDispatcher\Event;
  5. /**
  6. * Wraps a dump event for event listeners.
  7. *
  8. * @see \Drupal\reinstall\DumperEvents::REINSTALL_SERIALIZE_POST
  9. * @see \Drupal\reinstall\DumperEvents::SERIALIZE_PRE
  10. */
  11. class DumperEvent extends Event {
  12. /**
  13. * @var string
  14. */
  15. public $bundleName;
  16. /**
  17. * @var \Drupal\Core\Entity\EntityInterface[]
  18. */
  19. public $entities = [];
  20. /**
  21. * @var \Drupal\Core\Entity\EntityStorageInterface
  22. */
  23. public $storage;
  24. /**
  25. * DumperEvent constructor.
  26. *
  27. * @param \Drupal\Core\Entity\EntityStorageInterface $storage
  28. * @param string $bundleName
  29. * @param array $entities
  30. */
  31. public function __construct(EntityStorageInterface $storage, string $bundleName, array $entities) {
  32. $this->storage = $storage;
  33. $this->bundleName = $bundleName;
  34. $this->entities = $entities;
  35. }
  36. }