/** * Add commentaire * * @param \Perso\GalerieBundle\Entity\Commentaire $commentaire * * @return Photo */ public function addCommentaire(\Perso\GalerieBundle\Entity\Commentaire $commentaire) { $this->commentaires[] = $commentaire; $commentaire->setPhoto($this); // On ajoute ceci return $this; }