aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Repository/EntryRepository.php
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2015-09-28 19:35:55 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2015-09-28 19:35:55 +0200
commit159986c4fbf63dd93136ea5c52ff0be705aefaf3 (patch)
treee62f6ecb3174fac7e04e625d39ec4cd5808b2dcd /src/Wallabag/CoreBundle/Repository/EntryRepository.php
parentda3d4998c0972557952c83b610f8f45fdcd31b72 (diff)
downloadwallabag-159986c4fbf63dd93136ea5c52ff0be705aefaf3.tar.gz
wallabag-159986c4fbf63dd93136ea5c52ff0be705aefaf3.tar.zst
wallabag-159986c4fbf63dd93136ea5c52ff0be705aefaf3.zip
Fix Postgres tests
Diffstat (limited to 'src/Wallabag/CoreBundle/Repository/EntryRepository.php')
-rw-r--r--src/Wallabag/CoreBundle/Repository/EntryRepository.php36
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}