public function supprimerAction($id) { if ($id == null) { throw NotFoundHttpException('Acteur inexistant'); } //entity $em = $this->getDoctrine()->getManager(); //recupération de l'acteur $acteur = $em->getRepository('FilmothequeBundle:Acteur')->find($id); //suppression $em->remove($acteur); $em->flush(); return $this->redirect($this->generateUrl('acteur_liste')); }
public function voirAction($id) { //entity $em = $this->getDoctrine()->getManager(); // objet //$article = new Article(); //repository $article = $em->getRepository('BlogBundle:Article')->find($id); if ($article === null) { throw NotFoundHttpException('Article non retrouvé '); } return $this->render('BlogBundle:Blog:voir.html.twig', array('article' => $article)); }