src/EventListener/ArticleSharerSubscriber.php line 30

Open in your IDE?
  1. <?php
  2. namespace App\EventListener;
  3. use App\Entity\Article;
  4. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  5. use Symfony\Component\EventDispatcher\GenericEvent;
  6. class ArticleSharerSubscriber implements EventSubscriberInterface
  7. {
  8.     public static function getSubscribedEvents()
  9.     {
  10.         return [
  11.             'easy_admin.post_persist' => ['postPersist'],
  12.             'easy_admin.post_update' => ['postUpdate'],
  13.             'easy_admin.post_remove' => ['postRemove']
  14.         ];
  15.     }
  16.     public function postUpdate(GenericEvent $event)
  17.     {
  18.         $this->share($event);
  19.     }
  20.     public function postPersist(GenericEvent $event)
  21.     {
  22.         $this->share($event);
  23.     }
  24.     public function postRemove(GenericEvent $event)
  25.     {
  26.         $this->share($event);
  27.     }
  28.     public function share(GenericEvent $event)
  29.     {
  30.         $entity $event->getSubject();
  31.         if ($entity instanceof Article) {
  32.         }
  33.     }
  34.     private function generateRcmagText(Article $article)
  35.     {
  36.     }
  37.     private function generateRcnewsText(Article $article)
  38.     {
  39.     }
  40. }