src/Flowcode/ShopBundle/Controller/InventoryController.php
/**
     * Edits an existing Inventory entity.
     *
     * @Route("/stock/inventory/inventoryItem/{id}/save", name="stock_inventory_save")
     * @Method("POST")
     * @Template()
     */
Edits an existing Inventory entity.
Edits an existing Inventory entity .
public function saveStock(InventoryItem $inventoryItem, Request $request)
    {
        $answer = $this->get('flower.stock.service.inventory')->itemIsValid($inventoryItem);
        if ($answer == true) {
            $inventoryItem->setStock($request->get('stock'));
            return true;
        }
        return false;
    }
public function saveStock ( InventoryItem $ inventoryItem , Request $ request ) { $ answer = $ this -> get ( 'flower.stock.service.inventory' ) -> itemIsValid ( $ inventoryItem ) ; if ( $ answer == true ) { $ inventoryItem -> setStock ( $ request -> get ( 'stock' ) ) ; return true ; } return false ; }
Edits an existing Inventory entity.
Edits an existing Inventory entity .