src/Flowcode/ShopBundle/Controller/StockLevelController.php
public function createAction(Request $request)
    {
        $stocklevel = new StockLevel();
        $form = $this->createForm(new StockLevelType(), $stocklevel);
        if ($form->handleRequest($request)->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->persist($stocklevel);
            $em->flush();

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

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

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

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

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