tinternet.net/src/EventSuscriber/EntityManagerEventSubscriber.php

51 lines
1.2 KiB
PHP
Raw Normal View History

2021-03-16 10:37:12 +01:00
<?php
namespace App\EventSuscriber;
use App\Event\EntityManager\EntityManagerEvent;
2021-03-16 10:38:11 +01:00
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
2021-03-16 10:37:12 +01:00
/**
2021-03-17 15:57:07 +01:00
* class EntityManagerEventSubscriber.
2021-03-16 10:37:12 +01:00
*
* @author Simon Vieille <simon@deblan.fr>
*/
2021-03-17 20:42:09 +01:00
abstract class EntityManagerEventSubscriber implements EventSubscriberInterface
2021-03-16 10:37:12 +01:00
{
public static function getSubscribedEvents()
{
return [
EntityManagerEvent::CREATE_EVENT => 'onCreate',
EntityManagerEvent::UPDATE_EVENT => 'onUpdate',
EntityManagerEvent::DELETE_EVENT => 'onDelete',
2021-03-17 20:42:09 +01:00
EntityManagerEvent::PRE_CREATE_EVENT => 'onPreCreate',
EntityManagerEvent::PRE_UPDATE_EVENT => 'onPreUpdate',
EntityManagerEvent::PRE_DELETE_EVENT => 'onPreDelete',
2021-03-16 10:37:12 +01:00
];
}
public function onCreate(EntityManagerEvent $event)
{
}
public function onUpdate(EntityManagerEvent $event)
{
}
public function onDelete(EntityManagerEvent $event)
{
}
2021-03-17 20:42:09 +01:00
public function onPreCreate(EntityManagerEvent $event)
{
}
public function onPreUpdate(EntityManagerEvent $event)
{
}
public function onPreDelete(EntityManagerEvent $event)
{
}
2021-03-16 10:37:12 +01:00
}