*/ #[ORM\ManyToMany(targetEntity: Tagg::class, inversedBy: 'mails', cascade: ['persist'])] #[ORM\JoinTable(name: 'tag_message')] #[ORM\JoinColumn(name: 'message_id', referencedColumnName: 'id')] #[ORM\InverseJoinColumn(name: 'tag_id', referencedColumnName: 'id')] protected Collection $tags; public function __construct() { $this->uuid = Uuid::uuid4(); $this->files = new ArrayCollection(); $this->tags = new ArrayCollection(); parent::__construct(); } public function getAuthor(): ?Access { return $this->author; } public function setAuthor(?Access $author): self { $this->author = $author; return $this; } /** * @return Collection */ public function getTags(): Collection { return $this->tags; } public function addTag(Tagg $tag): self { if (!$this->tags->contains($tag)) { $this->tags[] = $tag; } return $this; } public function removeTag(Tagg $tag): self { $this->tags->removeElement($tag); return $this; } }