Beispiel #1
0
 public function creditsvoirAction(Request $request, $code)
 {
     $em = $this->getDoctrine()->getManager();
     $tdc = $em->getRepository('TRCCoreBundle:DDC\\TDC')->findOneByCode($code);
     if (is_null($tdc)) {
         throw $this->createNotFoundException("Error de code : " . $code);
     }
     $docs = $em->getRepository('TRCCoreBundle:DDC\\DOCTDC')->findBy(array("tdc" => $tdc), array(), null, 0);
     $doctdc = new DOCTDC();
     $doctdc->setTdc($tdc);
     $form = $this->get('form.factory')->create(new DOCTDCType(), $doctdc);
     if ($form->handleRequest($request)->isValid()) {
         $em->persist($doctdc);
         $em->flush();
         return $this->redirect($this->generateUrl('trc_admin_tdc_voir', array('code' => $code)));
     }
     return $this->render('TRCAdminBundle:Credits:creditsvoir.html.twig', array('tdc' => $tdc, "docs" => $docs, "form" => $form->createView()));
 }
 /**
  * {@inheritDoc}
  */
 public function getTdc()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getTdc', []);
     return parent::getTdc();
 }