mentions = new ArrayCollection(); $this->retweets = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function setId($id) { $this->id = $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; } /** * @return Collection|Retweets[] */ public function getRetweets(): Collection { return $this->retweets; } public function addRetweet(Retweets $retweet): self { if (!$this->retweets->contains($retweet)) { $this->retweets[] = $retweet; $retweet->setOgMessage($this); } return $this; } public function removeRetweet(Retweets $retweet): self { if ($this->retweets->removeElement($retweet)) { // set the owning side to null (unless already changed) if ($retweet->getOgMessage() === $this) { $retweet->setOgMessage(null); } } return $this; } }