]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Repository/EntryRepository.php
french translation
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Repository / EntryRepository.php
index 87b9befeb857abc47b9c44f3911aa7fdf81d28cc..57bf8024c150ae08537b6f7678d4b8c8160a3724 100644 (file)
@@ -161,4 +161,22 @@ class EntryRepository extends EntityRepository
 
         return $languages;
     }
+
+    /**
+     * Used only in test case to get the right entry associated to the right user.
+     *
+     * @param string $username
+     *
+     * @return Entry
+     */
+    public function findOneByUsernameAndNotArchived($username)
+    {
+        return $this->createQueryBuilder('e')
+            ->leftJoin('e.user', 'u')
+            ->where('u.username = :username')->setParameter('username', $username)
+            ->andWhere('e.isArchived = false')
+            ->setMaxResults(1)
+            ->getQuery()
+            ->getSingleResult();
+    }
 }