aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Repository/EntryRepository.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/Repository/EntryRepository.php')
-rw-r--r--src/Wallabag/CoreBundle/Repository/EntryRepository.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php
index 4b205f6e..24d1a57a 100644
--- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php
+++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php
@@ -88,6 +88,22 @@ class EntryRepository extends EntityRepository
88 } 88 }
89 89
90 /** 90 /**
91 * Retrieves untagged entries for a user.
92 *
93 * @param int $userId
94 *
95 * @return QueryBuilder
96 */
97 public function getBuilderForUntaggedByUser($userId)
98 {
99 return $this
100 ->getBuilderByUser($userId)
101 ->leftJoin('e.tags', 't')
102 ->groupBy('e.id')
103 ->having('count(t.id) = 0');
104 }
105
106 /**
91 * Find Entries. 107 * Find Entries.
92 * 108 *
93 * @param int $userId 109 * @param int $userId
@@ -226,6 +242,19 @@ class EntryRepository extends EntityRepository
226 } 242 }
227 243
228 /** 244 /**
245 * Remove tags from all user entries.
246 *
247 * @param int $userId
248 * @param Array<Tag> $tags
249 */
250 public function removeTags($userId, $tags)
251 {
252 foreach ($tags as $tag) {
253 $this->removeTag($userId, $tag);
254 }
255 }
256
257 /**
229 * Find all entries that are attached to a give tag id. 258 * Find all entries that are attached to a give tag id.
230 * 259 *
231 * @param int $userId 260 * @param int $userId