- $tags = $this->getDoctrine()->getRepository('WallabagCoreBundle:Tag')->findTagsForArchivedArticles($userId);
-
- if (empty($tags)) {
- return;
- }
-
- $this->getDoctrine()
- ->getRepository('WallabagCoreBundle:Entry')
- ->removeTags($userId, $tags);
-
- // cleanup orphan tags
- $em = $this->getDoctrine()->getManager();
-
- foreach ($tags as $tag) {
- if (count($tag->getEntries()) === 0) {
- $em->remove($tag);
- }
- }
+ $tags = $this->getDoctrine()->getRepository('WallabagCoreBundle:Tag')->findAllTags($userId);
+ $this->removeAllTagsByStatusAndUserId($tags, $userId);
+ }