mirror of
https://github.com/wallabag/wallabag.git
synced 2025-10-20 19:52:09 +00:00
parent
f98a2a0fc3
commit
0c83fd5994
13 changed files with 510 additions and 61 deletions
26
src/Wallabag/CoreBundle/Repository/UserRepository.php
Normal file
26
src/Wallabag/CoreBundle/Repository/UserRepository.php
Normal file
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Repository;
|
||||
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
|
||||
class UserRepository extends EntityRepository
|
||||
{
|
||||
/**
|
||||
* Find a user by its username and rss roken
|
||||
*
|
||||
* @param string $username
|
||||
* @param string $rssToken
|
||||
*
|
||||
* @return User|null
|
||||
*/
|
||||
public function findOneByUsernameAndRsstoken($username, $rssToken)
|
||||
{
|
||||
return $this->createQueryBuilder('u')
|
||||
->leftJoin('u.config', 'c')
|
||||
->where('c.rssToken = :rss_token')->setParameter('rss_token', $rssToken)
|
||||
->andWhere('u.username = :username')->setParameter('username', $username)
|
||||
->getQuery()
|
||||
->getOneOrNullResult();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue