*
* @XmlRoot("entry")
* @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\EntryRepository")
- * @ORM\Table(name="`entry`")
+ * @ORM\Table(name="`entry`", options={"collate"="utf8mb4_unicode_ci", "charset"="utf8mb4"})
* @ORM\HasLifecycleCallbacks()
* @Hateoas\Relation("self", href = "expr('/api/entries/' ~ object.getId())")
*/
* @ORM\JoinTable(
* name="entry_tag",
* joinColumns={
- * @ORM\JoinColumn(name="entry_id", referencedColumnName="id")
+ * @ORM\JoinColumn(name="entry_id", referencedColumnName="id", onDelete="cascade")
* },
* inverseJoinColumns={
- * @ORM\JoinColumn(name="tag_id", referencedColumnName="id")
+ * @ORM\JoinColumn(name="tag_id", referencedColumnName="id", onDelete="cascade")
* }
* )
- *
- * @Groups({"entries_for_user", "export_all"})
*/
private $tags;
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
*/