Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

123456789101112131415161718192021222324252627282930313233
  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. }