public function updateAction(InventoryItem $inventoryitem, Request $request)
    {
        $editForm = $this->createForm(new InventoryItemType(), $inventoryitem, array(
            'action' => $this->generateUrl('stock_inventoryitem_update', array('id' => $inventoryitem->getid())),
            'method' => 'PUT',
        ));
        if ($editForm->handleRequest($request)->isValid()) {
            $this->getDoctrine()->getManager()->flush();

            return $this->redirect($this->generateUrl('stock_inventoryitem_show', array('id' => $inventoryitem->getId())));
        }
        $deleteForm = $this->createDeleteForm($inventoryitem->getId(), 'stock_inventoryitem_delete');

        return array(
            'inventoryitem' => $inventoryitem,
            'edit_form' => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        );
    }
public function updateAction(InventoryItem $inventoryitem, Request $request)
    {
        $editForm = $this->createForm(new InventoryItemType(), $inventoryitem, array(
            'action' => $this->generateUrl('stock_inventoryitem_update', array('id' => $inventoryitem->getid())),
            'method' => 'PUT',
        ));
        if ($editForm->handleRequest($request)->isValid()) {
            $this->getDoctrine()->getManager()->flush();

            return $this->redirect($this->generateUrl('stock_inventoryitem_show', array('id' => $inventoryitem->getId())));
        }
        $deleteForm = $this->createDeleteForm($inventoryitem->getId(), 'stock_inventoryitem_delete');

        return array(
            'inventoryitem' => $inventoryitem,
            'edit_form' => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        );
    }
public function updateAction ( InventoryItem $ inventoryitem , Request $ request ) { $ editForm = $ this -> createForm ( new InventoryItemType ( ) , $ inventoryitem , array ( 'action' => $ this -> generateUrl ( 'stock_inventoryitem_update' , array ( 'id' => $ inventoryitem -> getid ( ) ) ) , 'method' => 'PUT' , ) ) ; if ( $ editForm -> handleRequest ( $ request ) -> isValid ( ) ) { $ this -> getDoctrine ( ) -> getManager ( ) -> flush ( ) ; return $ this -> redirect ( $ this -> generateUrl ( 'stock_inventoryitem_show' , array ( 'id' => $ inventoryitem -> getId ( ) ) ) ) ; } $ deleteForm = $ this -> createDeleteForm ( $ inventoryitem -> getId ( ) , 'stock_inventoryitem_delete' ) ; return array ( 'inventoryitem' => $ inventoryitem , 'edit_form' => $ editForm -> createView ( ) , 'delete_form' => $ deleteForm -> createView ( ) , ) ; }
Edits an existing InventoryItem entity.

@Route("/{id}/update", name="stock_inventoryitem_update", requirements={"id"="\d+"})
@Method("PUT")
@Template("FlowerStockBundle:InventoryItem:edit.html.twig")
Edits an existing InventoryItem entity .