<?php
namespace App\Event\Media\Entry;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class PersistSubscriber implements EventSubscriberInterface
{
public static function getSubscribedEvents()
{
return [
'media_entry.pre_persist' => 'onPrePersist',
'media_entry.post_persist' => 'onPostPersist'
];
}
public function onPrePersist(PrePersistEvent $event)
{
// $entry = $event->getEntry();
// $isCreated = $event->isCreate();
}
public function onPostPersist(PostPersistEvent $event)
{
// $entry = $event->getEntry();
// $isCreated = $event->isCreate();
}
}