diff options
Diffstat (limited to 'src/Wallabag/UserBundle/Repository')
-rw-r--r-- | src/Wallabag/UserBundle/Repository/UserRepository.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/Wallabag/UserBundle/Repository/UserRepository.php b/src/Wallabag/UserBundle/Repository/UserRepository.php index b1d753d2..be693d3b 100644 --- a/src/Wallabag/UserBundle/Repository/UserRepository.php +++ b/src/Wallabag/UserBundle/Repository/UserRepository.php | |||
@@ -3,6 +3,8 @@ | |||
3 | namespace Wallabag\UserBundle\Repository; | 3 | namespace Wallabag\UserBundle\Repository; |
4 | 4 | ||
5 | use Doctrine\ORM\EntityRepository; | 5 | use Doctrine\ORM\EntityRepository; |
6 | use Doctrine\ORM\QueryBuilder; | ||
7 | use Wallabag\UserBundle\Entity\User; | ||
6 | 8 | ||
7 | class UserRepository extends EntityRepository | 9 | class UserRepository extends EntityRepository |
8 | { | 10 | { |
@@ -54,6 +56,19 @@ class UserRepository extends EntityRepository | |||
54 | } | 56 | } |
55 | 57 | ||
56 | /** | 58 | /** |
59 | * Count how many users are existing. | ||
60 | * | ||
61 | * @return int | ||
62 | */ | ||
63 | public function getSumUsers() | ||
64 | { | ||
65 | return $this->createQueryBuilder('u') | ||
66 | ->select('count(u)') | ||
67 | ->getQuery() | ||
68 | ->getSingleScalarResult(); | ||
69 | } | ||
70 | |||
71 | /** | ||
57 | * Retrieves users filtered with a search term. | 72 | * Retrieves users filtered with a search term. |
58 | * | 73 | * |
59 | * @param string $term | 74 | * @param string $term |