diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2019-05-15 14:38:07 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2019-05-15 14:38:07 +0200 |
commit | 9f0957b831622ee577fa7d8f92ec0df6f3a8e274 (patch) | |
tree | 362e95af5fc0786e7934e0ab25764d90123bf997 /src/Wallabag/CoreBundle/Repository/SiteCredentialRepository.php | |
parent | 9e2194e9cb55acf0a715e36c33f9f9d8689e0761 (diff) | |
parent | 227a1a27f19604d64ffdfee56b4c8fc6b325bee6 (diff) | |
download | wallabag-9f0957b831622ee577fa7d8f92ec0df6f3a8e274.tar.gz wallabag-9f0957b831622ee577fa7d8f92ec0df6f3a8e274.tar.zst wallabag-9f0957b831622ee577fa7d8f92ec0df6f3a8e274.zip |
Merge remote-tracking branch 'origin/master' into 2.4
Diffstat (limited to 'src/Wallabag/CoreBundle/Repository/SiteCredentialRepository.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Repository/SiteCredentialRepository.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Wallabag/CoreBundle/Repository/SiteCredentialRepository.php b/src/Wallabag/CoreBundle/Repository/SiteCredentialRepository.php index b2e212a4..aeadd770 100644 --- a/src/Wallabag/CoreBundle/Repository/SiteCredentialRepository.php +++ b/src/Wallabag/CoreBundle/Repository/SiteCredentialRepository.php | |||
@@ -19,16 +19,16 @@ class SiteCredentialRepository extends \Doctrine\ORM\EntityRepository | |||
19 | /** | 19 | /** |
20 | * Retrieve one username/password for the given host and userId. | 20 | * Retrieve one username/password for the given host and userId. |
21 | * | 21 | * |
22 | * @param string $host | 22 | * @param array $hosts An array of host to look for |
23 | * @param int $userId | 23 | * @param int $userId |
24 | * | 24 | * |
25 | * @return array|null | 25 | * @return array|null |
26 | */ | 26 | */ |
27 | public function findOneByHostAndUser($host, $userId) | 27 | public function findOneByHostsAndUser($hosts, $userId) |
28 | { | 28 | { |
29 | $res = $this->createQueryBuilder('s') | 29 | $res = $this->createQueryBuilder('s') |
30 | ->select('s.username', 's.password') | 30 | ->select('s.username', 's.password') |
31 | ->where('s.host = :hostname')->setParameter('hostname', $host) | 31 | ->where('s.host IN (:hosts)')->setParameter('hosts', $hosts) |
32 | ->andWhere('s.user = :userId')->setParameter('userId', $userId) | 32 | ->andWhere('s.user = :userId')->setParameter('userId', $userId) |
33 | ->setMaxResults(1) | 33 | ->setMaxResults(1) |
34 | ->getQuery() | 34 | ->getQuery() |