aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/UserBundle/Repository
diff options
context:
space:
mode:
authorJeremy Benoist <j0k3r@users.noreply.github.com>2015-10-06 09:19:06 +0200
committerJeremy Benoist <j0k3r@users.noreply.github.com>2015-10-06 09:19:06 +0200
commit16dabc326311f084d671be188c7941bbb3c341c9 (patch)
tree3210a7688ea2bfa1bff5fd0422b52adf570edcdc /src/Wallabag/UserBundle/Repository
parentfdef5f460524215d806e244e5546865f4b8e01df (diff)
parent8263e71192989dc0fd28a41ac22f9c5b32eb11c4 (diff)
downloadwallabag-16dabc326311f084d671be188c7941bbb3c341c9.tar.gz
wallabag-16dabc326311f084d671be188c7941bbb3c341c9.tar.zst
wallabag-16dabc326311f084d671be188c7941bbb3c341c9.zip
Merge pull request #1436 from wallabag/v2-register
Public registration & oAuth2 \o/
Diffstat (limited to 'src/Wallabag/UserBundle/Repository')
-rw-r--r--src/Wallabag/UserBundle/Repository/UserRepository.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/Wallabag/UserBundle/Repository/UserRepository.php b/src/Wallabag/UserBundle/Repository/UserRepository.php
new file mode 100644
index 00000000..c020f3ca
--- /dev/null
+++ b/src/Wallabag/UserBundle/Repository/UserRepository.php
@@ -0,0 +1,26 @@
1<?php
2
3namespace Wallabag\UserBundle\Repository;
4
5use Doctrine\ORM\EntityRepository;
6
7class UserRepository extends EntityRepository
8{
9 /**
10 * Find a user by its username and rss roken.
11 *
12 * @param string $username
13 * @param string $rssToken
14 *
15 * @return User|null
16 */
17 public function findOneByUsernameAndRsstoken($username, $rssToken)
18 {
19 return $this->createQueryBuilder('u')
20 ->leftJoin('u.config', 'c')
21 ->where('c.rssToken = :rss_token')->setParameter('rss_token', $rssToken)
22 ->andWhere('u.username = :username')->setParameter('username', $username)
23 ->getQuery()
24 ->getOneOrNullResult();
25 }
26}