2021-03-24 19:10:26 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Core\EventSuscriber;
|
|
|
|
|
|
|
|
use App\Core\Event\EntityManager\EntityManagerEvent;
|
|
|
|
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* class EntityManagerEventSubscriber.
|
|
|
|
*
|
|
|
|
* @author Simon Vieille <simon@deblan.fr>
|
|
|
|
*/
|
|
|
|
abstract class EntityManagerEventSubscriber implements EventSubscriberInterface
|
|
|
|
{
|
2021-04-04 20:09:29 +02:00
|
|
|
static protected int $priority = 0;
|
|
|
|
|
2021-03-24 19:10:26 +01:00
|
|
|
public static function getSubscribedEvents()
|
|
|
|
{
|
|
|
|
return [
|
2021-04-04 20:09:29 +02:00
|
|
|
EntityManagerEvent::CREATE_EVENT => ['onCreate', self::$priority],
|
|
|
|
EntityManagerEvent::UPDATE_EVENT => ['onUpdate', self::$priority],
|
|
|
|
EntityManagerEvent::DELETE_EVENT => ['onDelete', self::$priority],
|
|
|
|
EntityManagerEvent::PRE_CREATE_EVENT => ['onPreCreate', self::$priority],
|
|
|
|
EntityManagerEvent::PRE_UPDATE_EVENT => ['onPreUpdate', self::$priority],
|
|
|
|
EntityManagerEvent::PRE_DELETE_EVENT => ['onPreDelete', self::$priority],
|
2021-03-24 19:10:26 +01:00
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
public function onCreate(EntityManagerEvent $event)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public function onUpdate(EntityManagerEvent $event)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public function onDelete(EntityManagerEvent $event)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public function onPreCreate(EntityManagerEvent $event)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public function onPreUpdate(EntityManagerEvent $event)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public function onPreDelete(EntityManagerEvent $event)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|