aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/AnnotationBundle/Repository
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2017-03-30 16:24:59 +0200
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2017-03-31 10:46:05 +0200
commit6da1aebc946e6448dd0d5080ee88e79c2bae4666 (patch)
tree43d350623f225ee560e040cd361d628454f2b1a7 /src/Wallabag/AnnotationBundle/Repository
parentfa884b30ba0f8cb4231bd37fff23ef2f41ae6cfa (diff)
downloadwallabag-6da1aebc946e6448dd0d5080ee88e79c2bae4666.tar.gz
wallabag-6da1aebc946e6448dd0d5080ee88e79c2bae4666.tar.zst
wallabag-6da1aebc946e6448dd0d5080ee88e79c2bae4666.zip
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 <tcit@tcit.fr>
Diffstat (limited to 'src/Wallabag/AnnotationBundle/Repository')
-rw-r--r--src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php16
1 files changed, 16 insertions, 0 deletions
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
122 ->setParameter('userId', $userId) 122 ->setParameter('userId', $userId)
123 ->execute(); 123 ->execute();
124 } 124 }
125
126 /**
127 * Find all annotations related to archived entries
128 *
129 * @param $userId
130 * @return mixed
131 */
132 public function findAllByArchivedEntriesAndUserId($userId)
133 {
134 return $this->createQueryBuilder('a')
135 ->leftJoin('a.entry', 'e')
136 ->where('a.user = :userid')->setParameter(':userid', $userId)
137 ->andWhere('e.isArchived = true')
138 ->getQuery()
139 ->getResult();
140 }
125} 141}