]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Repository/EntryRepository.php
Delete tag or tags by label
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Repository / EntryRepository.php
index 8d2ec9ce4f471d6f0f098dc7ec0558dbbbbe71fb..63c4c3be9f0f21f021a2c9d010f9fb3085499439 100644 (file)
@@ -92,6 +92,8 @@ class EntryRepository extends EntityRepository
      * @param bool   $isStarred
      * @param string $sort
      * @param string $order
+     * @param int    $since
+     * @param string $tags
      *
      * @return array
      */
@@ -111,7 +113,8 @@ class EntryRepository extends EntityRepository
 
         if ($since >= 0) {
             $qb->andWhere('e.updatedAt > :since')->setParameter('since', new \DateTime(date('Y-m-d H:i:s', $since)));
-            
+        }
+
         if ('' !== $tags) {
             foreach (explode(',', $tags) as $tag) {
                 $qb->andWhere('t.label = :label')->setParameter('label', $tag);
@@ -219,6 +222,19 @@ class EntryRepository extends EntityRepository
         $this->getEntityManager()->flush();
     }
 
+    /**
+     * Remove tags from all user entries
+     *
+     * @param int $userId
+     * @param Array<Tag> $tags
+     */
+
+    public function removeTags($userId, $tags) {
+        foreach ($tags as $tag) {
+            $this->removeTag($userId, $tag);
+        }
+    }
+
     /**
      * Find all entries that are attached to a give tag id.
      *