X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FEntity%2FTag.php;h=5aed1fa010008727e3550a6763f710d291ec212f;hb=46bbd8d321e6a00131f0e6ed96fa6f3d693b3678;hp=1cdf4df027cc772dcbedf8f8923276ded593a77a;hpb=6c87418ff013cfd03093c3f01e20518e580d80bb;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Entity/Tag.php b/src/Wallabag/CoreBundle/Entity/Tag.php index 1cdf4df0..5aed1fa0 100644 --- a/src/Wallabag/CoreBundle/Entity/Tag.php +++ b/src/Wallabag/CoreBundle/Entity/Tag.php @@ -6,6 +6,7 @@ use Doctrine\ORM\Mapping as ORM; use JMS\Serializer\Annotation\XmlRoot; use JMS\Serializer\Annotation\ExclusionPolicy; use JMS\Serializer\Annotation\Expose; +use Doctrine\Common\Collections\ArrayCollection; /** * Tag @@ -36,10 +37,14 @@ class Tag private $label; /** - * @ORM\ManyToMany(targetEntity="Entry", mappedBy="tags", cascade={"persist", "merge"}) + * @ORM\ManyToMany(targetEntity="Entry", mappedBy="tags", cascade={"persist"}) */ private $entries; + public function __construct() + { + $this->entries = new ArrayCollection(); + } /** * Get id * @@ -72,4 +77,9 @@ class Tag { return $this->label; } + + public function addEntry(Entry $entry) + { + $this->entries[] = $entry; + } }