aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Controller/TagController.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller/TagController.php')
-rw-r--r--src/Wallabag/CoreBundle/Controller/TagController.php5
1 files changed, 5 insertions, 0 deletions
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;
9use Symfony\Component\HttpFoundation\Request; 9use Symfony\Component\HttpFoundation\Request;
10use Wallabag\CoreBundle\Entity\Entry; 10use Wallabag\CoreBundle\Entity\Entry;
11use Wallabag\CoreBundle\Entity\Tag; 11use Wallabag\CoreBundle\Entity\Tag;
12use Wallabag\CoreBundle\Event\Activity\Actions\Entry\EntryTaggedEvent;
12use Wallabag\CoreBundle\Form\Type\NewTagType; 13use Wallabag\CoreBundle\Form\Type\NewTagType;
13use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; 14use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
14 15
@@ -37,6 +38,8 @@ class TagController extends Controller
37 $em->persist($entry); 38 $em->persist($entry);
38 $em->flush(); 39 $em->flush();
39 40
41 $this->get('event_dispatcher')->dispatch(EntryTaggedEvent::NAME, new EntryTaggedEvent($entry, $tags));
42
40 $this->get('session')->getFlashBag()->add( 43 $this->get('session')->getFlashBag()->add(
41 'notice', 44 'notice',
42 'flashes.tag.notice.tag_added' 45 'flashes.tag.notice.tag_added'
@@ -64,6 +67,8 @@ class TagController extends Controller
64 $em = $this->getDoctrine()->getManager(); 67 $em = $this->getDoctrine()->getManager();
65 $em->flush(); 68 $em->flush();
66 69
70 $this->get('event_dispatcher')->dispatch(EntryTaggedEvent::NAME, new EntryTaggedEvent($entry, $tag), true);
71
67 // remove orphan tag in case no entries are associated to it 72 // remove orphan tag in case no entries are associated to it
68 if (count($tag->getEntries()) === 0) { 73 if (count($tag->getEntries()) === 0) {
69 $em->remove($tag); 74 $em->remove($tag);