X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FEntity%2FEntry.php;h=bd712a0449c498ed9108bd3aac174a809a13a75d;hb=c32ae320fec4135f5b32d57ef88349317a3b1f3f;hp=f11a77860450105624623e5eae91869fbac09849;hpb=39643c6b76d92d509b1af0228b6379d7fdce8a1c;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index f11a7786..bd712a04 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php @@ -4,11 +4,12 @@ namespace Wallabag\CoreBundle\Entity; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\Mapping as ORM; -use Symfony\Component\Validator\Constraints as Assert; use Hateoas\Configuration\Annotation as Hateoas; use JMS\Serializer\Annotation\Groups; use JMS\Serializer\Annotation\XmlRoot; +use Symfony\Component\Validator\Constraints as Assert; use Wallabag\UserBundle\Entity\User; +use Wallabag\AnnotationBundle\Entity\Annotation; /** * Entry. @@ -98,13 +99,12 @@ class Entry private $updatedAt; /** - * @var string - * - * @ORM\Column(name="comments", type="text", nullable=true) + * @ORM\OneToMany(targetEntity="Wallabag\AnnotationBundle\Entity\Annotation", mappedBy="entry", cascade={"persist", "remove"}) + * @ORM\JoinTable * - * @Groups({"export_all"}) + * @Groups({"entries_for_user", "export_all"}) */ - private $comments; + private $annotations; /** * @var string @@ -168,7 +168,7 @@ class Entry private $user; /** - * @ORM\ManyToMany(targetEntity="Tag", inversedBy="entries", cascade={"persist"}) + * @ORM\ManyToMany(targetEntity="Tag", inversedBy="entries", cascade={"persist", "remove"}) * @ORM\JoinTable * * @Groups({"entries_for_user", "export_all"}) @@ -366,19 +366,19 @@ class Entry } /** - * @return string + * @return ArrayCollection */ - public function getComments() + public function getAnnotations() { - return $this->comments; + return $this->annotations; } /** - * @param string $comments + * @param Annotation $annotation */ - public function setComments($comments) + public function setAnnotation(Annotation $annotation) { - $this->comments = $comments; + $this->annotations[] = $annotation; } /**