src/Event/Media/Category/PersistSubscriber.php line 22

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