use JMS\Serializer\Annotation\XmlRoot;
use Symfony\Component\Validator\Constraints as Assert;
use Wallabag\UserBundle\Entity\User;
+use Wallabag\CommentBundle\Entity\Comment;
/**
* Entry.
private $updatedAt;
/**
- * @var string
- *
- * @ORM\Column(name="comments", type="text", nullable=true)
+ * @ORM\OneToMany(targetEntity="Wallabag\CommentBundle\Entity\Comment", mappedBy="entry", cascade={"persist", "remove"})
+ * @ORM\JoinTable
*
- * @Groups({"export_all"})
+ * @Groups({"entries_for_user", "export_all"})
*/
private $comments;
}
/**
- * @return string
+ * @return ArrayCollection<Comment>
*/
public function getComments()
{
}
/**
- * @param string $comments
+ * @param Comment $comment
*/
- public function setComments($comments)
+ public function setComment(Comment $comment)
{
- $this->comments = $comments;
+ $this->comments[] = $comment;
}
/**