X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FEntity%2FEntry.php;h=f2da3f4def670d5a0e08af123a1617a2cb3fa509;hb=e39aec3e38144f1a2ddb0027ec724e3dfd6f53f1;hp=c3e6b4d5d35305b3ff3b7fbca1ec58365b7489ea;hpb=c078d18372e05b09b40c34f67b7cb81446f30c4f;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index c3e6b4d5..f2da3f4d 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php @@ -97,7 +97,7 @@ class Entry private $content; /** - * @var date + * @var \DateTime * * @ORM\Column(name="created_at", type="datetime") * @@ -106,7 +106,7 @@ class Entry private $createdAt; /** - * @var date + * @var \DateTime * * @ORM\Column(name="updated_at", type="datetime") * @@ -196,8 +196,6 @@ class Entry * @ORM\JoinColumn(name="tag_id", referencedColumnName="id") * } * ) - * - * @Groups({"entries_for_user", "export_all"}) */ private $tags; @@ -410,7 +408,22 @@ class Entry } /** - * @return string + * Set created_at. + * Only used when importing data from an other service. + * + * @param \DateTime $createdAt + * + * @return Entry + */ + public function setCreatedAt(\DateTime $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @return \DateTime */ public function getCreatedAt() { @@ -418,7 +431,7 @@ class Entry } /** - * @return string + * @return \DateTime */ public function getUpdatedAt() { @@ -526,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 */