diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Repository')
-rw-r--r-- | src/Wallabag/CoreBundle/Repository/EntryRepository.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index 87b9befe..0e82b9b2 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php | |||
@@ -161,4 +161,40 @@ 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 findOneByUsernameAndNotStarred($username) | ||
173 | { | ||
174 | return $this->createQueryBuilder('e') | ||
175 | ->leftJoin('e.user', 'u') | ||
176 | ->where('u.username = :username')->setParameter('username', $username) | ||
177 | ->andWhere('e.isStarred = false') | ||
178 | ->setMaxResults(1) | ||
179 | ->getQuery() | ||
180 | ->getSingleResult(); | ||
181 | } | ||
182 | |||
183 | /** | ||
184 | * Used only in test case to get the right entry associated to the right user | ||
185 | * | ||
186 | * @param string $username | ||
187 | * | ||
188 | * @return Entry | ||
189 | */ | ||
190 | public function findOneByUsernameAndNotArchived($username) | ||
191 | { | ||
192 | return $this->createQueryBuilder('e') | ||
193 | ->leftJoin('e.user', 'u') | ||
194 | ->where('u.username = :username')->setParameter('username', $username) | ||
195 | ->andWhere('e.isArchived = false') | ||
196 | ->setMaxResults(1) | ||
197 | ->getQuery() | ||
198 | ->getSingleResult(); | ||
199 | } | ||
164 | } | 200 | } |