diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Repository/EntryRepository.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Repository/EntryRepository.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index 87b9befe..2286317c 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php | |||
@@ -161,4 +161,22 @@ class EntryRepository extends EntityRepository | |||
161 | 161 | ||
162 | return $languages; | 162 | return $languages; |
163 | } | 163 | } |
164 | |||
165 | /** | ||
166 | * Used only in test case to get the right entry associated to the right user | ||
167 | * | ||
168 | * @param string $username | ||
169 | * | ||
170 | * @return Entry | ||
171 | */ | ||
172 | public function findOneByUsernameAndNotArchived($username) | ||
173 | { | ||
174 | return $this->createQueryBuilder('e') | ||
175 | ->leftJoin('e.user', 'u') | ||
176 | ->where('u.username = :username')->setParameter('username', $username) | ||
177 | ->andWhere('e.isArchived = false') | ||
178 | ->setMaxResults(1) | ||
179 | ->getQuery() | ||
180 | ->getSingleResult(); | ||
181 | } | ||
164 | } | 182 | } |