Controller/CenterController.php
public function updateAction(Request $request, $id)
    {
        $em = $this->getDoctrine()->getManager();

        $center = $em->getRepository('ChillMainBundle:Center')->find($id);

        if (!$center) {
            throw $this->createNotFoundException('Unable to find Center entity.');
        }

        $editForm = $this->createEditForm($center);
        $editForm->handleRequest($request);

        if ($editForm->isValid()) {
            $em->flush();

            return $this->redirect($this->generateUrl('admin_center_edit', array('id' => $id)));
        }

        return $this->render('ChillMainBundle:Center:edit.html.twig', array(
            'entity'      => $center,
            'edit_form'   => $editForm->createView()
        ));
    }
public function updateAction(Request $request, $id)
    {
        $em = $this->getDoctrine()->getManager();

        $center = $em->getRepository('ChillMainBundle:Center')->find($id);

        if (!$center) {
            throw $this->createNotFoundException('Unable to find Center entity.');
        }

        $editForm = $this->createEditForm($center);
        $editForm->handleRequest($request);

        if ($editForm->isValid()) {
            $em->flush();

            return $this->redirect($this->generateUrl('admin_center_edit', array('id' => $id)));
        }

        return $this->render('ChillMainBundle:Center:edit.html.twig', array(
            'entity'      => $center,
            'edit_form'   => $editForm->createView()
        ));
    }
public function updateAction ( Request $ request , $ id ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ center = $ em -> getRepository ( 'ChillMainBundle:Center' ) -> find ( $ id ) ; if ( ! $ center ) { throw $ this -> createNotFoundException ( 'Unable to find Center entity.' ) ; } $ editForm = $ this -> createEditForm ( $ center ) ; $ editForm -> handleRequest ( $ request ) ; if ( $ editForm -> isValid ( ) ) { $ em -> flush ( ) ; return $ this -> redirect ( $ this -> generateUrl ( 'admin_center_edit' , array ( 'id' => $ id ) ) ) ; } return $ this -> render ( 'ChillMainBundle:Center:edit.html.twig' , array ( 'entity' => $ center , 'edit_form' => $ editForm -> createView ( ) ) ) ; }
Edits an existing Center entity.
Edits an existing Center entity .