]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Entity/Entry.php
Merge pull request #3256 from wallabag/fix-patch
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Entity / Entry.php
index 581e890666ba9e5c6ea21a25646d1e759435e5c7..cba72d31e07385ba736638df84c14862a31cf5a1 100644 (file)
@@ -593,6 +593,11 @@ class Entry
         $tag->addEntry($this);
     }
 
+    /**
+     * Remove the given tag from the entry (if the tag is associated).
+     *
+     * @param Tag $tag
+     */
     public function removeTag(Tag $tag)
     {
         if (!$this->tags->contains($tag)) {
@@ -603,6 +608,17 @@ class Entry
         $tag->removeEntry($this);
     }
 
+    /**
+     * Remove all assigned tags from the entry.
+     */
+    public function removeAllTags()
+    {
+        foreach ($this->tags as $tag) {
+            $this->tags->removeElement($tag);
+            $tag->removeEntry($this);
+        }
+    }
+
     /**
      * Set previewPicture.
      *