mentions = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getText(): ?string { return $this->text; } public function setText(string $text): self { $this->text = $text; return $this; } public function getSender(): ?User { return $this->sender; } public function setSender(?User $sender): self { $this->sender = $sender; return $this; } /** * @return Collection|User[] */ public function getMentions(): Collection { return $this->mentions; } public function addMention(User $mention): self { if (!$this->mentions->contains($mention)) { $this->mentions[] = $mention; } return $this; } public function removeMention(User $mention): self { $this->mentions->removeElement($mention); return $this; } public function getDate(): ?\DateTimeInterface { return $this->date; } public function setDate(\DateTimeInterface $date): self { $this->date = $date; return $this; } }