diff options
author | Jeremy Benoist <j0k3r@users.noreply.github.com> | 2017-01-27 09:34:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-27 09:34:32 +0100 |
commit | 6fb06904ecde15b1b07d0a2af945338b416cf0e2 (patch) | |
tree | e76f3e8142399316ec5660fab8c646b2c34b8336 /src/Wallabag/UserBundle/Repository/UserRepository.php | |
parent | 05fa529bcfde01be5d320cb532900d72cf4b0830 (diff) | |
parent | 78295b99dd1721c613f1ce52e2debbe6f6db7753 (diff) | |
download | wallabag-6fb06904ecde15b1b07d0a2af945338b416cf0e2.tar.gz wallabag-6fb06904ecde15b1b07d0a2af945338b416cf0e2.tar.zst wallabag-6fb06904ecde15b1b07d0a2af945338b416cf0e2.zip |
Merge pull request #2416 from wallabag/2.2
wallabag 2.2.0
Diffstat (limited to 'src/Wallabag/UserBundle/Repository/UserRepository.php')
-rw-r--r-- | src/Wallabag/UserBundle/Repository/UserRepository.php | 14 |
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..f913f52d 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.enabled = true') | ||
52 | ->getQuery() | ||
53 | ->getSingleScalarResult(); | ||
54 | } | ||
41 | } | 55 | } |