From 6da1aebc946e6448dd0d5080ee88e79c2bae4666 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Thu, 30 Mar 2017 16:24:59 +0200 Subject: Allow to remove all archived entries Since we still support fucking SQLite, we need to retrieve all tags & annotations for archived entries before deleting them. Signed-off-by: Thomas Citharel --- .../AnnotationBundle/Repository/AnnotationRepository.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/Wallabag/AnnotationBundle') diff --git a/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php b/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php index 8d3f07ee..23f21c3e 100644 --- a/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php +++ b/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php @@ -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(); + } } -- cgit v1.2.3 From 9102851f59d960869b210bb26ab0e9c266781c4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 31 Mar 2017 10:53:23 +0200 Subject: Added delete button on Baggy theme --- src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Wallabag/AnnotationBundle') diff --git a/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php b/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php index 23f21c3e..3af53805 100644 --- a/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php +++ b/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php @@ -124,9 +124,10 @@ class AnnotationRepository extends EntityRepository } /** - * Find all annotations related to archived entries + * Find all annotations related to archived entries. * * @param $userId + * * @return mixed */ public function findAllByArchivedEntriesAndUserId($userId) -- cgit v1.2.3 From 13a592a1288d7deb49211838368583c0109a5fbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 31 Mar 2017 17:03:08 +0200 Subject: Renamed methods --- src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Wallabag/AnnotationBundle') diff --git a/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php b/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php index 3af53805..da361308 100644 --- a/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php +++ b/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php @@ -130,7 +130,7 @@ class AnnotationRepository extends EntityRepository * * @return mixed */ - public function findAllByArchivedEntriesAndUserId($userId) + public function findAllArchivedEntriesByUser($userId) { return $this->createQueryBuilder('a') ->leftJoin('a.entry', 'e') -- cgit v1.2.3