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