aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Controller/TagController.php
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2016-02-10 17:41:28 +0100
committerThomas Citharel <tcit@tcit.fr>2016-02-10 17:41:28 +0100
commit567421af5019bf5937aa2b4214b405d87a1f1f86 (patch)
treed1f8d3ad8593a3a6f33662217a81cbd731287fc9 /src/Wallabag/CoreBundle/Controller/TagController.php
parentae5b37ef2e52c06182bc6edb14f6b3aae381ddb4 (diff)
downloadwallabag-567421af5019bf5937aa2b4214b405d87a1f1f86.tar.gz
wallabag-567421af5019bf5937aa2b4214b405d87a1f1f86.tar.zst
wallabag-567421af5019bf5937aa2b4214b405d87a1f1f86.zip
remove tag from entry #1377
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller/TagController.php')
-rw-r--r--src/Wallabag/CoreBundle/Controller/TagController.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/TagController.php b/src/Wallabag/CoreBundle/Controller/TagController.php
index ff4d64a8..7b34939d 100644
--- a/src/Wallabag/CoreBundle/Controller/TagController.php
+++ b/src/Wallabag/CoreBundle/Controller/TagController.php
@@ -56,6 +56,26 @@ class TagController extends Controller
56 } 56 }
57 57
58 /** 58 /**
59 * Removes tag from entry.
60 *
61 * @Route("/remove-tag/{entry}/{tag}", requirements={"entry" = "\d+", "tag" = "\d+"}, name="remove_tag")
62 *
63 * @return \Symfony\Component\HttpFoundation\Response
64 */
65 public function removeTagFromEntry(Request $request, Entry $entry, Tag $tag)
66 {
67 $entry->removeTag($tag);
68 $em = $this->getDoctrine()->getManager();
69 $em->flush();
70 if (count($tag->getEntries()) == 0) {
71 $em->remove($tag);
72 }
73 $em->flush();
74
75 return $this->redirect($request->headers->get('referer'));
76 }
77
78 /**
59 * Shows tags for current user. 79 * Shows tags for current user.
60 * 80 *
61 * @Route("/tag/list", name="tag") 81 * @Route("/tag/list", name="tag")