From f38e03dc02c96344677fd2720912605b21c90b5d Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Sun, 7 Feb 2016 16:52:59 +0100 Subject: Comment work with annotator v2 - add missing annotator.js file and fix typo - edit & delete routes, started tests - basic tests --- src/Wallabag/CoreBundle/Entity/Entry.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/Wallabag/CoreBundle/Entity') diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index bf8db5ab..5cf84f03 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php @@ -9,6 +9,7 @@ use JMS\Serializer\Annotation\Groups; use JMS\Serializer\Annotation\XmlRoot; use Symfony\Component\Validator\Constraints as Assert; use Wallabag\UserBundle\Entity\User; +use Wallabag\CommentBundle\Entity\Comment; /** * Entry. @@ -98,11 +99,10 @@ class 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; @@ -366,7 +366,7 @@ class Entry } /** - * @return string + * @return ArrayCollection */ public function getComments() { @@ -374,11 +374,11 @@ class Entry } /** - * @param string $comments + * @param Comment $comment */ - public function setComments($comments) + public function setComment(Comment $comment) { - $this->comments = $comments; + $this->comments[] = $comment; } /** -- cgit v1.2.3