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(),
        );
    }