From ad51743e8bd15782a25c5e717c87786d34091ce3 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') diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index 16c44885..77d88c9c 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -129,6 +129,20 @@ class EntryRepository extends EntityRepository ->andWhere('t.id is null'); } + /** + * 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 From 0f2d24feb4709bf0ea97e6152e8a607aaa3c1c72 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 5 Jun 2019 17:09:05 +0200 Subject: Fix typo & CS --- src/Wallabag/CoreBundle/Repository/EntryRepository.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/Wallabag/CoreBundle/Repository') diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index 77d88c9c..d9675982 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -131,15 +131,16 @@ class EntryRepository extends EntityRepository /** * Retrieve the number of untagged entries for a user. - * + * * @param int $userId - * + * * @return int */ public function countUntaggedEntriesByUser($userId) { - return $this->getRawBuilderForUntaggedByUser($userId) + return (int) $this->getRawBuilderForUntaggedByUser($userId) ->select('count(e.id)') + ->getQuery() ->getSingleScalarResult(); } -- cgit v1.2.3