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