From bf6c0346d8d35a719dd1bff1cb4d573d422f99ff Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Wed, 31 May 2017 09:31:18 +0200 Subject: WIP Signed-off-by: Thomas Citharel --- src/Wallabag/CoreBundle/Controller/TagController.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/Wallabag/CoreBundle/Controller/TagController.php') diff --git a/src/Wallabag/CoreBundle/Controller/TagController.php b/src/Wallabag/CoreBundle/Controller/TagController.php index a8b1eadd..6cc78458 100644 --- a/src/Wallabag/CoreBundle/Controller/TagController.php +++ b/src/Wallabag/CoreBundle/Controller/TagController.php @@ -9,6 +9,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\Tag; +use Wallabag\CoreBundle\Event\Activity\Actions\Entry\EntryTaggedEvent; use Wallabag\CoreBundle\Form\Type\NewTagType; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; @@ -37,6 +38,8 @@ class TagController extends Controller $em->persist($entry); $em->flush(); + $this->get('event_dispatcher')->dispatch(EntryTaggedEvent::NAME, new EntryTaggedEvent($entry, $tags)); + $this->get('session')->getFlashBag()->add( 'notice', 'flashes.tag.notice.tag_added' @@ -64,6 +67,8 @@ class TagController extends Controller $em = $this->getDoctrine()->getManager(); $em->flush(); + $this->get('event_dispatcher')->dispatch(EntryTaggedEvent::NAME, new EntryTaggedEvent($entry, $tag), true); + // remove orphan tag in case no entries are associated to it if (count($tag->getEntries()) === 0) { $em->remove($tag); -- cgit v1.2.3