]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Entity/Entry.php
Fix relations export for Entry
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Entity / Entry.php
index a4b0d7a82b4c436ed4bc79b6154e88590da36847..f2da3f4def670d5a0e08af123a1617a2cb3fa509 100644 (file)
@@ -196,8 +196,6 @@ class Entry
      *      @ORM\JoinColumn(name="tag_id", referencedColumnName="id")
      *  }
      * )
-     *
-     * @Groups({"entries_for_user", "export_all"})
      */
     private $tags;
 
@@ -541,6 +539,21 @@ class Entry
         return $this->tags;
     }
 
+    /**
+     * @VirtualProperty
+     * @SerializedName("tags")
+     * @Groups({"entries_for_user", "export_all"})
+     */
+    public function getSerializedTags()
+    {
+        $data = [];
+        foreach ($this->tags as $tag) {
+            $data[] = $tag->getLabel();
+        }
+
+        return $data;
+    }
+
     /**
      * @param Tag $tag
      */