diff options
Diffstat (limited to 'src/Wallabag/UserBundle')
-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 c020f3ca..009c4881 100644 --- a/src/Wallabag/UserBundle/Repository/UserRepository.php +++ b/src/Wallabag/UserBundle/Repository/UserRepository.php | |||
@@ -23,4 +23,19 @@ class UserRepository extends EntityRepository | |||
23 | ->getQuery() | 23 | ->getQuery() |
24 | ->getOneOrNullResult(); | 24 | ->getOneOrNullResult(); |
25 | } | 25 | } |
26 | |||
27 | /** | ||
28 | * Find a user by its username. | ||
29 | * | ||
30 | * @param string $username | ||
31 | * | ||
32 | * @return User | ||
33 | */ | ||
34 | public function findOneByUserName($username) | ||
35 | { | ||
36 | return $this->createQueryBuilder('u') | ||
37 | ->andWhere('u.username = :username')->setParameter('username', $username) | ||
38 | ->getQuery() | ||
39 | ->getSingleResult(); | ||
40 | } | ||
26 | } | 41 | } |