src/Bse/CandidatureBundle/Controller/CandidatureController.php
/**
     * Edits an existing Candidature entity.
     *
     */
Edits an existing Candidature entity.
Edits an existing Candidature entity .
public function updateAction(Request $request, $id)
    {
        $em = $this->getDoctrine()->getManager();
        $entity = $em->getRepository('BseCandidatureBundle:Candidature')->find($id);
        if (!$entity) {
            throw $this->createNotFoundException('Unable to find Candidature entity.');
        }
        $editForm = $this->createEditForm($entity);
        $editForm->handleRequest($request);        
        if ($editForm->isValid()) {
            $em->flush();
            $this->get('session')->getFlashBag()->add('notice',  'Votre candidature a bien été modifiée !');
            return $this->redirect($this->generateUrl('bse_candidature_welcome'));
        }
        $filieresChoosed = explode("//", $entity->getFiliere());
        return $this->render('BseCandidatureBundle:Candidature:edit.html.twig', array(
            'entity'      => $entity,
            'edit_form'   => $editForm->createView(),
            'filieresChoosed' => $filieresChoosed,
            'filieresData' => ArrayData::getFilieresData($this->container),
            'paysData' => ArrayData::getPaysData($this->get('kernel')),
            'villesData' => ArrayData::getVillesData($this->get('kernel')),
            'systemesData' => ArrayData::getSystemesData(),
            'mentionsData' => ArrayData::getMentionsData(),
            'etablissementsData' => ArrayData::getEtablissementsData($this->get('kernel')),
            'typesDiplomeData' => ArrayData::getTypesDiplomeData(),
            'intitulesDiplomeData' => ArrayData::getIntitulesDiplomeData($this->get('kernel')),
            'facultesData' => ArrayData::getFacultesData()
        ));
    }
public function updateAction ( Request $ request , $ id ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ entity = $ em -> getRepository ( 'BseCandidatureBundle:Candidature' ) -> find ( $ id ) ; if ( ! $ entity ) { throw $ this -> createNotFoundException ( 'Unable to find Candidature entity.' ) ; } $ editForm = $ this -> createEditForm ( $ entity ) ; $ editForm -> handleRequest ( $ request ) ; if ( $ editForm -> isValid ( ) ) { $ em -> flush ( ) ; $ this -> get ( 'session' ) -> getFlashBag ( ) -> add ( 'notice' , 'Votre candidature a bien été modifiée !'); return $ this -> redirect ( $ this -> generateUrl ( 'bse_candidature_welcome' ) ) ; } $ filieresChoosed = explode ( " // " , $ entity -> getFiliere ( ) ) ; return $ this -> render ( 'BseCandidatureBundle:Candidature:edit.html.twig' , array ( 'entity' => $ entity , 'edit_form' => $ editForm -> createView ( ) , 'filieresChoosed' => $ filieresChoosed , 'filieresData' => ArrayData :: getFilieresData ( $ this -> container ) , 'paysData' => ArrayData :: getPaysData ( $ this -> get ( 'kernel' ) ) , 'villesData' => ArrayData :: getVillesData ( $ this -> get ( 'kernel' ) ) , 'systemesData' => ArrayData :: getSystemesData ( ) , 'mentionsData' => ArrayData :: getMentionsData ( ) , 'etablissementsData' => ArrayData :: getEtablissementsData ( $ this -> get ( 'kernel' ) ) , 'typesDiplomeData' => ArrayData :: getTypesDiplomeData ( ) , 'intitulesDiplomeData' => ArrayData :: getIntitulesDiplomeData ( $ this -> get ( 'kernel' ) ) , 'facultesData' => ArrayData :: getFacultesData ( ) ) ) ; }
Edits an existing Candidature entity.
Edits an existing Candidature entity .
//$deleteForm = $this->createDeleteForm($id); //'delete_form' => $deleteForm->createView(),