tinternet.net/src/Event/EntityManager/EntityManagerEvent.php

31 lines
643 B
PHP
Raw Normal View History

2021-03-16 10:37:12 +01:00
<?php
namespace App\Event\EntityManager;
2021-03-17 12:44:02 +01:00
use App\Entity\EntityInterface;
2021-03-16 10:38:11 +01:00
use Symfony\Contracts\EventDispatcher\Event;
2021-03-16 10:37:12 +01:00
/**
* class EntityEvent.
*
* @author Simon Vieille <simon@deblan.fr>
*/
class EntityManagerEvent extends Event
{
const CREATE_EVENT = 'entity_manager_event.create';
const UPDATE_EVENT = 'entity_manager_event.update';
const DELETE_EVENT = 'entity_manager_event.delete';
2021-03-17 12:44:02 +01:00
protected EntityInterface $entity;
2021-03-16 10:37:12 +01:00
2021-03-17 12:44:02 +01:00
public function __construct(EntityInterface $entity)
2021-03-16 10:37:12 +01:00
{
$this->entity = $entity;
}
2021-03-17 12:44:02 +01:00
public function getEntity(): EntityInterface
2021-03-16 10:37:12 +01:00
{
return $this->entity;
}
}