<?php
namespace App\EventListener;
use App\Entity\Article;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\EventDispatcher\GenericEvent;
class ArticleSharerSubscriber implements EventSubscriberInterface
{
public static function getSubscribedEvents()
{
return [
'easy_admin.post_persist' => ['postPersist'],
'easy_admin.post_update' => ['postUpdate'],
'easy_admin.post_remove' => ['postRemove']
];
}
public function postUpdate(GenericEvent $event)
{
$this->share($event);
}
public function postPersist(GenericEvent $event)
{
$this->share($event);
}
public function postRemove(GenericEvent $event)
{
$this->share($event);
}
public function share(GenericEvent $event)
{
$entity = $event->getSubject();
if ($entity instanceof Article) {
}
}
private function generateRcmagText(Article $article)
{
}
private function generateRcnewsText(Article $article)
{
}
}