diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-10-02 16:06:42 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-10-07 07:43:19 +0200 |
commit | b0458874c85060c992aa1cb78dec91ee85082b74 (patch) | |
tree | ce2e75fd05c22c28a79ee5dcd5f6fb72b02673b8 /src/Wallabag/CoreBundle/Entity/Entry.php | |
parent | 9d127b3b9365c73bc393bc303545f24c159cee31 (diff) | |
download | wallabag-b0458874c85060c992aa1cb78dec91ee85082b74.tar.gz wallabag-b0458874c85060c992aa1cb78dec91ee85082b74.tar.zst wallabag-b0458874c85060c992aa1cb78dec91ee85082b74.zip |
Fix relations export for Entry
Tags & Annotations weren’t really well exported.
This is now fixed (+ tests)
Diffstat (limited to 'src/Wallabag/CoreBundle/Entity/Entry.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Entity/Entry.php | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index a4b0d7a8..f2da3f4d 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php | |||
@@ -196,8 +196,6 @@ class Entry | |||
196 | * @ORM\JoinColumn(name="tag_id", referencedColumnName="id") | 196 | * @ORM\JoinColumn(name="tag_id", referencedColumnName="id") |
197 | * } | 197 | * } |
198 | * ) | 198 | * ) |
199 | * | ||
200 | * @Groups({"entries_for_user", "export_all"}) | ||
201 | */ | 199 | */ |
202 | private $tags; | 200 | private $tags; |
203 | 201 | ||
@@ -542,6 +540,21 @@ class Entry | |||
542 | } | 540 | } |
543 | 541 | ||
544 | /** | 542 | /** |
543 | * @VirtualProperty | ||
544 | * @SerializedName("tags") | ||
545 | * @Groups({"entries_for_user", "export_all"}) | ||
546 | */ | ||
547 | public function getSerializedTags() | ||
548 | { | ||
549 | $data = []; | ||
550 | foreach ($this->tags as $tag) { | ||
551 | $data[] = $tag->getLabel(); | ||
552 | } | ||
553 | |||
554 | return $data; | ||
555 | } | ||
556 | |||
557 | /** | ||
545 | * @param Tag $tag | 558 | * @param Tag $tag |
546 | */ | 559 | */ |
547 | public function addTag(Tag $tag) | 560 | public function addTag(Tag $tag) |