src/Event/Media/Entry/PersistSubscriber.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Event\Media\Entry;
  3. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  4. class PersistSubscriber implements EventSubscriberInterface
  5. {
  6.     public static function getSubscribedEvents()
  7.     {
  8.         return [
  9.             'media_entry.pre_persist' => 'onPrePersist',
  10.             'media_entry.post_persist' => 'onPostPersist'
  11.         ];
  12.     }
  13.     
  14.     public function onPrePersist(PrePersistEvent $event)
  15.     {
  16.         // $entry = $event->getEntry();
  17.         // $isCreated = $event->isCreate();
  18.     }
  19.     
  20.     public function onPostPersist(PostPersistEvent $event)
  21.     {
  22.         // $entry = $event->getEntry();
  23.         // $isCreated = $event->isCreate();
  24.     }
  25. }