src/Cpm/JovenesBundle/Controller/InvitacionController.php
/**
     * Edits an existing Invitacion entity.
     *
     * @Route("/{id}/update", name="invitaciones_update")
     * @Method("post")
     * @Template("CpmJovenesBundle:Invitacion:edit.html.twig")
     */
Edits an existing Invitacion entity.
Edits an existing Invitacion entity .
public function updateAction($id)
    {
        $em = $this->getDoctrine()->getEntityManager();
		$entity = $this->getEntityForUpdate('CpmJovenesBundle:Invitacion', $id, $em);
        $editForm   = $this->createForm(new InvitacionType(), $entity);
        $deleteForm = $this->createDeleteForm($id);
        $request = $this->getRequest();
        $editForm->bindRequest($request);
        if ($editForm->isValid()) {
            $em->persist($entity);
            $em->flush();
            return $this->redirect($this->generateUrl('invitaciones_edit', array('id' => $id)));
        }
        return array(
            'entity'      => $entity,
            'edit_form'   => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        );
    }
public function updateAction ( $ id ) { $ em = $ this -> getDoctrine ( ) -> getEntityManager ( ) ; $ entity = $ this -> getEntityForUpdate ( 'CpmJovenesBundle:Invitacion' , $ id , $ em ) ; $ editForm = $ this -> createForm ( new InvitacionType ( ) , $ entity ) ; $ deleteForm = $ this -> createDeleteForm ( $ id ) ; $ request = $ this -> getRequest ( ) ; $ editForm -> bindRequest ( $ request ) ; if ( $ editForm -> isValid ( ) ) { $ em -> persist ( $ entity ) ; $ em -> flush ( ) ; return $ this -> redirect ( $ this -> generateUrl ( 'invitaciones_edit' , array ( 'id' => $ id ) ) ) ; } return array ( 'entity' => $ entity , 'edit_form' => $ editForm -> createView ( ) , 'delete_form' => $ deleteForm -> createView ( ) , ) ; }
Edits an existing Invitacion entity.
Edits an existing Invitacion entity .