You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
885B

  1. <?php
  2. namespace Lc\SovBundle\Event\EntityManager;
  3. use Lc\SovBundle\Doctrine\EntityInterface;
  4. use Symfony\Contracts\EventDispatcher\Event;
  5. /**
  6. * class EntityEvent.
  7. *
  8. * @author Simon Vieille <simon@deblan.fr>
  9. */
  10. class EntityManagerEvent extends Event
  11. {
  12. const PRE_CREATE_EVENT = 'entity_manager_event.pre_create';
  13. const POST_CREATE_EVENT = 'entity_manager_event.post_create';
  14. const PRE_UPDATE_EVENT = 'entity_manager_event.pre_update';
  15. const POST_UPDATE_EVENT = 'entity_manager_event.post_update';
  16. const PRE_DELETE_EVENT = 'entity_manager_event.pre_delete';
  17. const POST_DELETE_EVENT = 'entity_manager_event.post_delete';
  18. protected EntityInterface $entity;
  19. public function __construct(EntityInterface $entity)
  20. {
  21. $this->entity = $entity;
  22. }
  23. public function getEntity(): EntityInterface
  24. {
  25. return $this->entity;
  26. }
  27. }