public function voirAction($id) { $Commentaire = new Commentaire(); $Commentaire->setTitre("Essai de Commentaire"); $Commentaire->setAuteur("Auteur"); $Commentaire->setTexte("C'est fort intéressant. Merci de l'avoir dit tout haut!"); $em = $this->getDoctrine()->getManager(); $Commentaire = $em->getRepository('VFBlogBundle:Commentaire')->find($id); if (null === $Commentaire) { throw new NotFoundHttpException("Le commentaire d'id " . $id . " n'existe pas."); } return $this->render('VFBlogBundle:Commentaire:voir.html.twig', array('commentaire' => $Commentaire)); }
/** * {@inheritDoc} */ public function setTitre($titre) { $this->__initializer__ && $this->__initializer__->__invoke($this, 'setTitre', [$titre]); return parent::setTitre($titre); }