use JMS\Serializer\Annotation\XmlRoot;
use JMS\Serializer\Annotation\ExclusionPolicy;
use JMS\Serializer\Annotation\Expose;
+use Doctrine\Common\Collections\ArrayCollection;
/**
* 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
*
{
return $this->label;
}
+
+ public function addEntry(Entry $entry)
+ {
+ $this->entries[] = $entry;
+ }
}