From 86fd3da135d9ca2241dc09680d5dac1dd57fc707 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sun, 2 Sep 2018 16:43:49 +0200 Subject: Show untagged entries count on tag list Closes #3235 Signed-off-by: Kevin Decherf --- src/Wallabag/CoreBundle/Repository/EntryRepository.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/Wallabag/CoreBundle/Repository/EntryRepository.php') diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index b5e35eff..3a1f19b4 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -115,6 +115,20 @@ class EntryRepository extends EntityRepository ->andWhere('size(e.tags) = 0'); } + /** + * Retrieve the number of untagged entries for a user. + * + * @param int $userId + * + * @return int + */ + public function countUntaggedEntriesByUser($userId) + { + return $this->getRawBuilderForUntaggedByUser($userId) + ->select('count(e.id)') + ->getSingleScalarResult(); + } + /** * Find Entries. * -- cgit v1.2.3