X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FUserBundle%2FRepository%2FUserRepository.php;h=445edb3c1077cb2826e2937cb7fccdff2ae4e2be;hb=3f604467564e86623513107161587f7e34d4f369;hp=009c4881d0ea8945379e159894f00b4ca51a1f2d;hpb=625acf335298186b4ff983f9321900d1238e854b;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/UserBundle/Repository/UserRepository.php b/src/Wallabag/UserBundle/Repository/UserRepository.php index 009c4881..445edb3c 100644 --- a/src/Wallabag/UserBundle/Repository/UserRepository.php +++ b/src/Wallabag/UserBundle/Repository/UserRepository.php @@ -38,4 +38,18 @@ class UserRepository extends EntityRepository ->getQuery() ->getSingleResult(); } + + /** + * Count how many users are enabled. + * + * @return int + */ + public function getSumEnabledUsers() + { + return $this->createQueryBuilder('u') + ->select('count(u)') + ->andWhere('u.expired = false') + ->getQuery() + ->getSingleScalarResult(); + } }