]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php
Merge remote-tracking branch 'origin/master' into 2.3
[github/wallabag/wallabag.git] / src / Wallabag / AnnotationBundle / Repository / AnnotationRepository.php
index 8d3f07eef350f2eb8ebf12a05b80deb5f6d026fb..da3613089ced7a19d5e6b74961dc251c39a233b1 100644 (file)
@@ -122,4 +122,21 @@ class AnnotationRepository extends EntityRepository
             ->setParameter('userId', $userId)
             ->execute();
     }
+
+    /**
+     * Find all annotations related to archived entries.
+     *
+     * @param $userId
+     *
+     * @return mixed
+     */
+    public function findAllArchivedEntriesByUser($userId)
+    {
+        return $this->createQueryBuilder('a')
+            ->leftJoin('a.entry', 'e')
+            ->where('a.user = :userid')->setParameter(':userid', $userId)
+            ->andWhere('e.isArchived = true')
+            ->getQuery()
+            ->getResult();
+    }
 }