/**
  * {@inheritDoc}
  */
 public function getNomComplet()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getNomComplet', array());
     return parent::getNomComplet();
 }
 public function ajouterAction(Request $request)
 {
     $verif = false;
     if ($request->isXmlHttpRequest()) {
         $libelle = $request->request->get('libelle');
         $nomComplet = $request->request->get('nomComplet');
         $ufrverifs = $this->getDoctrine()->getRepository('AERGUSassociationBundle:Ufr')->findAll();
         foreach ($ufrverifs as $ufr) {
             if ($ufr->getLibelle() == $libelle && $ufr->getNomComplet() == $nomComplet) {
                 $verif = true;
             }
         }
         if ($verif == true) {
             return new Response('error');
         }
         $ufr = new Ufr();
         $ufr->setLibelle($libelle);
         $ufr->setNomComplet($nomComplet);
         $em = $this->getDoctrine()->getManager();
         $em->persist($ufr);
         $em->flush();
         $ufrs = $this->getDoctrine()->getRepository('AERGUSassociationBundle:Ufr')->findAll();
         return $this->render('AERGUSassociationBundle:AdminOrientation:ajouter.html.twig', array('ufrs' => $ufrs));
     } else {
         throw new \Exception("Erreur");
     }
 }