diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2015-09-28 22:57:11 +0200 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2015-09-28 22:57:11 +0200 |
commit | 917040d4a0b7694ca4f695c02243ffb4283d6901 (patch) | |
tree | 0bd70455b7748145a7b944d47c6845ba214b2b4d /src/Wallabag/CoreBundle/Repository | |
parent | 4180fddac1aa011f121a1ab901f9f21aafa46112 (diff) | |
parent | fef4124130484ebdb8194b83a3278e6f970a46fb (diff) | |
download | wallabag-917040d4a0b7694ca4f695c02243ffb4283d6901.tar.gz wallabag-917040d4a0b7694ca4f695c02243ffb4283d6901.tar.zst wallabag-917040d4a0b7694ca4f695c02243ffb4283d6901.zip |
Merge pull request #1434 from wallabag/travis-db
Add multiple database tests on Travis
Diffstat (limited to 'src/Wallabag/CoreBundle/Repository')
-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 | } |