src/Event/News/Category/PersistSubscriber.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Event\News\Category;
  3. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  4. class PersistSubscriber implements EventSubscriberInterface
  5. {
  6.     public static function getSubscribedEvents()
  7.     {
  8.         return [
  9.             'news_category.pre_persist' => 'onPrePersist',
  10.             'news_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. }