src/Flowcode/ShopBundle/Controller/AdminStockChangeLogController.php
/**
     * Creates a new StockChangeLog entity.
     *
     * @Route("/create", name="admin_shop_changelog_create")
     * @Method("POST")
     * @Template("FlowerStockBundle:StockChangeLog:new.html.twig")
     */
Creates a new StockChangeLog entity.
Creates a new StockChangeLog entity .
public function createAction(Request $request)
    {
        $stockchangelog = new StockChangeLog();
        $form = $this->createForm(new StockChangeLogType(), $stockchangelog);
        if ($form->handleRequest($request)->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->persist($stockchangelog);
            $em->flush();
            return $this->redirect($this->generateUrl('admin_shop_changelog_show', array('id' => $stockchangelog->getId())));
        }
        return array(
            'stockchangelog' => $stockchangelog,
            'form' => $form->createView(),
        );
    }
public function createAction ( Request $ request ) { $ stockchangelog = new StockChangeLog ( ) ; $ form = $ this -> createForm ( new StockChangeLogType ( ) , $ stockchangelog ) ; if ( $ form -> handleRequest ( $ request ) -> isValid ( ) ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ em -> persist ( $ stockchangelog ) ; $ em -> flush ( ) ; return $ this -> redirect ( $ this -> generateUrl ( 'admin_shop_changelog_show' , array ( 'id' => $ stockchangelog -> getId ( ) ) ) ) ; } return array ( 'stockchangelog' => $ stockchangelog , 'form' => $ form -> createView ( ) , ) ; }
Creates a new StockChangeLog entity.
Creates a new StockChangeLog entity .