/** * Add comment * * @param \AppBundle\Entity\Comment $comment * * @return Repo */ public function addComment(\AppBundle\Entity\Comment $comment) { if (!$this->comments->contains($this)) { $this->comments->add($comment); } if ($comment->getRepo() !== $this) { $comment->setRepo($this); } }