forked from wallabag/wallabag
Fix relations export for Entry
Tags & Annotations weren’t really well exported. This is now fixed (+ tests)
This commit is contained in:
@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user