X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FAnnotationBundle%2FRepository%2FAnnotationRepository.php;h=da3613089ced7a19d5e6b74961dc251c39a233b1;hb=873f6b8e03079d11fab541aa5b0bc6f8fe2d645e;hp=8d3f07eef350f2eb8ebf12a05b80deb5f6d026fb;hpb=f17b89fadce0a8c2280fbe1518d66f20dddce59d;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php b/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php index 8d3f07ee..da361308 100644 --- a/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php +++ b/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php @@ -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(); + } }