/** * @Secure(roles="ROLE_USER") */ public function ajouterPourAction(Serie $serie) { $episode = new Episode(); $user = $this->container->get('security.context')->getToken()->getUser(); if (is_object($user) and $user and $user instanceof UserInterface) { $episode->setUser($user); } $form = $this->createForm(new EpisodeType($serie->getId()), $episode); $formHandler = new EpisodeHandler($form, $this->get('request'), $this->getDoctrine()->getEntityManager()); if ($formHandler->process()) { return new Response("ok -- send"); } return $this->render('SerieZoneSerieBundle:Episode:Ajouter.html.twig', array('form' => $form->createView())); }
public function getId() { $this->__load(); return parent::getId(); }