$em->flush();
// remove orphan tag in case no entries are associated to it
- if (count($tag->getEntries()) === 0) {
+ if (0 === count($tag->getEntries())) {
$em->remove($tag);
$em->flush();
}
{
$tags = $this->get('wallabag_core.tag_repository')
->findAllFlatTagsWithNbEntries($this->getUser()->getId());
+ $untagged = $this->get('wallabag_core.entry_repository')
+ ->countUntaggedEntriesForUser($this->getUser()->getId());
return $this->render('WallabagCoreBundle:Tag:tags.html.twig', [
'tags' => $tags,
+ 'untagged' => $untagged
]);
}