aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/UserBundle/Repository/UserRepository.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2016-09-08 14:07:36 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2016-10-08 13:27:18 +0200
commitbb0c78f4a636fcc8f60dd3b42ad733e7f31e0bb4 (patch)
treec9209d37cf5db197e2fa45e7164b55af7a92e374 /src/Wallabag/UserBundle/Repository/UserRepository.php
parentabb5291cd5dc98211273e5d3b516a6a0ed8b980f (diff)
downloadwallabag-bb0c78f4a636fcc8f60dd3b42ad733e7f31e0bb4.tar.gz
wallabag-bb0c78f4a636fcc8f60dd3b42ad733e7f31e0bb4.tar.zst
wallabag-bb0c78f4a636fcc8f60dd3b42ad733e7f31e0bb4.zip
Added check if there is only one user
Added translations and documentation
Diffstat (limited to 'src/Wallabag/UserBundle/Repository/UserRepository.php')
-rw-r--r--src/Wallabag/UserBundle/Repository/UserRepository.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Wallabag/UserBundle/Repository/UserRepository.php b/src/Wallabag/UserBundle/Repository/UserRepository.php
index 009c4881..178761e6 100644
--- a/src/Wallabag/UserBundle/Repository/UserRepository.php
+++ b/src/Wallabag/UserBundle/Repository/UserRepository.php
@@ -38,4 +38,18 @@ class UserRepository extends EntityRepository
38 ->getQuery() 38 ->getQuery()
39 ->getSingleResult(); 39 ->getSingleResult();
40 } 40 }
41
42 /**
43 * Count how many users are enabled.
44 *
45 * @return int
46 */
47 public function getSumEnabledUsers()
48 {
49 return $this->createQueryBuilder('u')
50 ->select('count(u)')
51 ->andWhere('u.expired = 0')
52 ->getQuery()
53 ->getSingleScalarResult();
54 }
41} 55}