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;
$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'
$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);