/** * {@inheritDoc} */ public function getMembres() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getMembres', array()); return parent::getMembres(); }
public function addSectionAction(Request $request) { if ($request->isXmlHttpRequest()) { $libelle = $request->request->get('libelle'); $id = $request->request->get('id'); $ufr = $this->getDoctrine()->getRepository('AERGUSassociationBundle:Ufr')->find($id); $section = new Section(); $section->setLibelle($libelle); $section->setUfr($ufr); $validator = $this->get('validator'); $listErrors = $validator->validate($section); $em = $this->getDoctrine()->getManager(); $em->persist($section); $em->flush(); $sections = $ufr->getSections(); return $this->render('AERGUSassociationBundle:AdminOrientation:addSection.html.twig', array('sections' => $sections)); } else { throw new \Exception("Erreur"); } }