Update the specified resource in storage.

@param  Product $product
@param  UpdateProductRequest $request
@return Response
971469
public function update(Product $product, UpdateProductRequest $request)
    {
        $this->product->update($product, $request->all());

        return redirect()->route('admin.product.product.index')
            ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::products.title.products')]));
    }
471711
public function postProductAddonsAction(Request $request, $productId)
    {
        $locale = $this->getProductLocaleManager()->retrieveLocale($this->getUser(), $request->get('locale'));

        $addonId = $request->get('addon');
        $prices = $request->get('prices');

        $addon = $this->getManager()->saveProductAddon($productId, $addonId, $locale, $prices);

        $this->getDoctrine()->getManager()->flush();

        $view = $this->view($addon, 200);

        return $this->handleView($view);
    }
1296583
public function updateAction(Request $request, Product $entity)
    {
        $em = $this->getDoctrine()->getManager();

        $entity = $this->addProductItemFieldData($entity);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find Product entity.');
        }

        $deleteForm = $this->createDeleteForm($entity->getId());
        $editForm = $this->createEditForm($entity);
        $editForm->handleRequest($request);

        if ($editForm->isValid()) {
            /* @var ProductRawMaterial $productRawMaterial */
            foreach ($entity->getRawMaterials() as $productRawMaterial) {
                $productRawMaterial->setProduct($entity);
            }
            $em->flush();

            return $this->redirect($this->generateUrl('admin_product_show', array('id' => $entity->getId())));
        }

        return array(
            'entity' => $entity,
            'edit_form' => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        );
    }
1006555
public function uploadAction(Product $product)
    {
        if (!$product) {
            throw $this->createNotFoundException('Unable to find Product entity.');
        }

        $productService = $this->get('amulen.shop.product');
        $response = $productService->uploadImage($product);

        $httpResponse = Response::HTTP_BAD_REQUEST;

        if ($response['upload_ok'] != 0) {
            $path = $response['target_file'];
            $em = $this->getDoctrine()->getManager();
            $mediaTypeRepository = $em->getRepository(MediaType::class);

            $mediaType = $mediaTypeRepository->findOneBy([
                'name' => 'image'
            ]);

            $media = new Media();
            $name = basename($_FILES["file"]["name"]);
            $slugName = strtolower(str_replace(' ','-',$name));
            $media->setName($slugName);
            $media->setPath($path);
            $media->setMediaType($mediaType);
            $em->persist($media);

            $galleryItem = new GalleryItem();
            $gallery = $product->getMediaGallery();
            $gallery->addGalleryItem($galleryItem);
            $galleryItem->setGallery($gallery);
            $galleryItem->setMedia($media);
            $position = $gallery->getGalleryItems()->count() + 1;
            $galleryItem->setPosition($position);

            $em->persist($galleryItem);
            $em->flush();
            $httpResponse = Response::HTTP_OK;
        }

        if ($response['upload_ok'] == 2) {
            $httpResponse = Response::HTTP_BAD_REQUEST;
        }

        return new JsonResponse($response['message'], $httpResponse);
    }
765899
public function update(CartItem $cartitem, UpdateCartItemRequest $request)
    {
        $this->cartitem->update($cartitem, $request->all());

        return redirect()->route('admin.cart.cartitem.index')
            ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('cart::cartitems.title.cartitems')]));
    }
478234
public function update(Product &$product)
    {
        $data = $product->exportData();
        $endpoint = '/admin/products/'.$product->id.'.json';
        $response = $this->request(
            $endpoint, 'PUT', array(
            'product' => $data
            )
        );
        $product->setData($response['product']);
    }
1274067
public function update(ProductsRequest $request, $item)
	{
		$this->products->update(
			$request->all(), $item
		);

		return back()->with('status', trans('globals.success_text'));
	}
743820
def update(opts)
      opts = opts.merge(:product_id => self.product_id)
      Twocheckout::API.request(:post, 'products/update_product', opts)
      response = Twocheckout::API.request(:get, 'products/detail_product', opts)
      Product.new(response['product'])
    end
107180
public function update(Storage $storage, UpdateStorageRequest $request)
    {
        $this->storage->update($storage, $request->all());

        return redirect()->route('admin.product.storage.index')
            ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));
    }
1370484
public function update(Request $request, $id)
    {
        $response = $this->repository->update($id, $request->all());
        return Response::apiResponse([
            'data' => $response
        ]);

    }
383659
protected function updateProductClass($product_class_id)
    {
        if (!$this->isError() && !$this->product_class->update($product_class_id, $this->getSubmitted())) {
            $this->errorAndExit($this->text('Unexpected result'));
        }
    }
356101
protected function setProduct($product_id)
    {
        $this->data_product = array();

        if (is_numeric($product_id)) {

            $conditions = array(
                'language' => 'und',
                'product_id' => $product_id
            );

            $this->data_product = $this->product->get($conditions);

            if (empty($this->data_product)) {
                $this->outputHttpStatus(404);
            }

            $this->prepareProduct($this->data_product);
        }
    }
870132
public function update(ProductVariant &$productVariant)
    {
        $data = $productVariant->exportData();
        $endpoint = '/admin/variants/'.$productVariant->id.'.json';
        $response = $this->request(
            $endpoint, 'PUT', array(
            'variant' => $data
            )
        );
        $productVariant->setData($response['variant']);
    }
1176238
public function updateAction(Request $request)
    {
        $form = $this->buildForm(null, $this->find($action = 'update'));

        if (in_array($request->getMethod(), ['POST', 'PUT', 'PATCH'], true)
            && $this->submitForm($form, $request)->isValid()) {
            try {
                $this->getDomainManager()->update($form->getData());
            } catch (DomainException $e) {
                $this->processException($e);
            }
        }

        return $this->processAction($action, $form);
    }
1169858
public function cgetAction(Request $request, $productId)
    {
        $locale = $this->getProductLocaleManager()->retrieveLocale($this->getUser(), $request->get('locale'));

        $list = $this->createListRepresentation($request, $locale, $productId);

        $view = $this->view($list, Response::HTTP_OK);

        return $this->handleView($view);
    }
652150
public function updateAction(Request $request)
    {
        $parameters = $this->serializer->deserialize(json_decode($request->getContent(), true));

        return new JsonResponse($parameters);
    }
1010059
public function update(Request $request, Product $itemgroup)
	{
		$itemgroup->groupWith(
			$request->get('associates')
		);

		return redirect()
			->route('itemgroup.edit', $itemgroup)
			->with('status', trans('globals.success_text'));
	}