public function createAction(Request $request)
    {
        $measureunit = new MeasureUnit();
        $form = $this->createForm(new MeasureUnitType(), $measureunit);
        if ($form->handleRequest($request)->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->persist($measureunit);
            $em->flush();

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

        return array(
            'measureunit' => $measureunit,
            'form' => $form->createView(),
        );
    }
public function createAction(Request $request)
    {
        $measureunit = new MeasureUnit();
        $form = $this->createForm(new MeasureUnitType(), $measureunit);
        if ($form->handleRequest($request)->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->persist($measureunit);
            $em->flush();

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

        return array(
            'measureunit' => $measureunit,
            'form' => $form->createView(),
        );
    }
public function createAction ( Request $ request ) { $ measureunit = new MeasureUnit ( ) ; $ form = $ this -> createForm ( new MeasureUnitType ( ) , $ measureunit ) ; if ( $ form -> handleRequest ( $ request ) -> isValid ( ) ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ em -> persist ( $ measureunit ) ; $ em -> flush ( ) ; return $ this -> redirect ( $ this -> generateUrl ( 'admin_shop_measure_unit_show' , array ( 'id' => $ measureunit -> getId ( ) ) ) ) ; } return array ( 'measureunit' => $ measureunit , 'form' => $ form -> createView ( ) , ) ; }
Creates a new MeasureUnit entity.

@Route("/create", name="admin_shop_measure_unit_create")
@Method("POST")
@Template("FlowerStockBundle:MeasureUnit:new.html.twig")
Creates a new MeasureUnit entity .