EntityModifiedEvent.php 561 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace App\Event;
  3. use Symfony\Component\EventDispatcher\Event;
  4. class EntityModifiedEvent extends Event {
  5. private $before;
  6. private $after;
  7. public function __construct($before, $after) {
  8. if (!isset($before, $after)) {
  9. throw new \InvalidArgumentException('$before and/or $after cannot be null');
  10. }
  11. $this->before = $before;
  12. $this->after = $after;
  13. }
  14. public function getBefore() {
  15. return $this->before;
  16. }
  17. public function getAfter() {
  18. return $this->after;
  19. }
  20. }