X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FAnnotationBundle%2FRepository%2FAnnotationRepository.php;h=3af53805bd1a9db1741525ffc801b6a1696c9334;hb=e682a70f88338af66b8d47bfe078e32fd9c6520c;hp=8d3f07eef350f2eb8ebf12a05b80deb5f6d026fb;hpb=20da238413d1c6cc360d58a13df33eb199fa5f05;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php b/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php index 8d3f07ee..3af53805 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 findAllByArchivedEntriesAndUserId($userId) + { + return $this->createQueryBuilder('a') + ->leftJoin('a.entry', 'e') + ->where('a.user = :userid')->setParameter(':userid', $userId) + ->andWhere('e.isArchived = true') + ->getQuery() + ->getResult(); + } }