Allows you to upload a new product image.

@param string $product
@param array  $data
@param string $storeView
@param string $identifierType

@return ActionInterface
177681
public function create($product, $data, $storeView = null, $identifierType = null)
    {
        return $this->__createAction('catalogProductAttributeMediaCreate', func_get_args());
    }
3499
private function initStoreProductData($productId, $storeId)
    {
        if (!array_key_exists($productId, $this->attributeData)) {
            $this->attributeData[$productId] = [];
        }

        if (!array_key_exists($storeId, $this->attributeData[$productId])) {
            $this->attributeData[$productId][$storeId] = [];
        }
    }
327731
public function insert($productId, $skuId, Licensing_LicenseAssignmentInsert $postBody, $optParams = array())
  {
    $params = array('productId' => $productId, 'skuId' => $skuId, 'postBody' => $postBody);
    $params = array_merge($params, $optParams);
    return $this->call('insert', array($params), "Licensing_LicenseAssignment");
  }
731486
protected function _instantiateEntity($identifier, $data)
    {
        //since the identifier doesn't have an
        //application set, it gets the application of the parent
        //repository
        $identifier = AnService::getIdentifier($identifier);
        $identifier->application = $this->getIdentifier()->application;

        return clone AnDomain::getRepository($identifier)->getClone();
    }
805455
public function build(
        $action,
        array $data,
        CliInput $input,
        Mapping $mapping
    )
    {
        $payloadMeta = $this->mapper->getPayloadMeta($data);
        if ($action === 'request') {
            return new RequestApi(
                $this->logger->getRequestLogger($payloadMeta->getId()),
                $this->component,
                $mapping,
                dirname(realpath($_SERVER['SCRIPT_FILENAME'])),
                $input->getName(),
                $input->getVersion(),
                $input->getFrameworkVersion(),
                $input->getVariables(),
                $input->isDebug(),
                $this->mapper->getHttpRequest($data),
                $this->mapper->getServiceCall($data),
                $payloadMeta,
                $this->mapper->getRequestAttributes($data)
            );

        } elseif($action === 'response') {
            return new ResponseApi(
                $this->logger->getRequestLogger($payloadMeta->getId()),
                $this->component,
                $mapping,
                dirname(realpath($_SERVER['SCRIPT_FILENAME'])),
                $input->getName(),
                $input->getVersion(),
                $input->getFrameworkVersion(),
                $input->getVariables(),
                $input->isDebug(),
                $this->mapper->getHttpRequest($data),
                $this->mapper->getHttpResponse($data),
                $this->mapper->getTransport($data),
                $this->mapper->getPayloadMeta($data),
                $this->mapper->getReturnValue($data)
            );
        }

    }
1241493
public function assignProduct($categoryId, $productId, $position = null, $identifierType = null)
    {
        return $this->__createAction('catalog_category.assignProduct', func_get_args());
    }
1253058
public function handle(ProductRepository $productRepository, ProductTypeRepository $productTypeRepository,
                           Dispatcher $event)
    {
        $productNumber = is_null($this->productNumber)
            ? ProductNumber::first()
            : ProductNumber::parse($this->productNumber);

        $productType = $productTypeRepository->find($this->productTypeId);
        $product = Product::instantiate($productNumber, $productType, $this->description);
        $productRepository->save($product);
        $event->fire(new ProductWasStored($product));
        return $product;
    }
408929
public function add($sku, $name, Money $price, Closure $action = null)
    {
        $product = new Product($sku, $name, $price, $this->rate);

        if ($action) {
          $product->action($action);
        }

        $this->products->add($sku, $product);
    }
795698
public function addData($storeId, array $indexData)
    {
        $inventoryData = $this->getResourceModel()->loadInventoryData($storeId, array_keys($indexData));

        foreach ($inventoryData as $inventoryDataRow) {
            $productId = (int) $inventoryDataRow['product_id'];
            $indexData[$productId]['stock'] = [
                'is_in_stock' => (bool) $inventoryDataRow['stock_status'],
                'qty'         => (int) $inventoryDataRow['qty'],
            ];
        }

        return $indexData;
    }
34979
private function mediaCreateEditForm(Media $entity, $product, $type)
    {
        $types = $this->container->getParameter('flowcode_media.media_types');
        $class = $types[$entity->getMediaType()]["class_type"];

        $form = $this->createForm(new $class(), $entity, array(
            'action' => $this->generateUrl('admin_product_media_update', array("product" => $product->getId(), 'entity' => $entity->getId(), "type" => $entity->getMediaType())),
            'method' => 'PUT',
        ));

        $form->add('submit', 'submit', array('label' => 'Update'));

        return $form;
    }
117069
public function update($product_id, array $data)
    {
        $result = null;
        $this->hook->attach('product.update.before', $product_id, $data, $result, $this);

        if (isset($result)) {
            return (bool) $result;
        }

        $data['modified'] = GC_TIME;
        $data['product_id'] = $product_id;

        $this->setPrice($data);

        $updated = $this->db->update('product', $data, array('product_id' => $product_id));

        $updated += (int) $this->setSku($data);
        $updated += (int) $this->setTranslations($data, $this->translation_entity, 'product');
        $updated += (int) $this->setImages($data, $this->file, 'product');
        $updated += (int) $this->setAlias($data, $this->alias, 'product');
        $updated += (int) $this->setSkuCombinations($data);
        $updated += (int) $this->setOptions($data);
        $updated += (int) $this->setAttributes($data);
        $updated += (int) $this->setRelated($data);

        $result = $updated > 0;

        if ($result) {
            $this->search->index('product', $product_id);
        }

        $this->hook->attach('product.update.after', $product_id, $data, $result, $this);
        return (bool) $result;
    }
557437
def image_upload(self, product_id, position, session, pic_path=None, image=None):
        ''''''
        request = TOPRequest('taobao.fenxiao.product.image.upload')
        request['product_id'] = product_id
        request['position'] = position
        if pic_path!=None: request['pic_path'] = pic_path
        if image!=None: request['image'] = image
        self.create(self.execute(request, session), fields=['result','created'], models={'created':TOPDate})
        return self
374033
protected function addProductToProductHeap(SpyProduct $productEntity): void
    {
        if (static::$productHeapSize >= static::HEAP_LIMIT) {
            $this->clearProductHeap();
        }

        static::$productHeapSize++;
        static::$productHeap[$productEntity->getSku()] = [
            static::PRODUCT_CONCRETE_ID => $productEntity->getIdProduct(),
            static::PRODUCT_ABSTRACT_ID => $productEntity->getFkProductAbstract(),
        ];
    }
1252310
public function update($product_sku, $uid)
    {
        $product = Subbly::api('subbly.product')->find($product_sku);

        if (!Input::hasFile('product_image')) {
            return $this->jsonErrorResponse('"product_image" is required.');
        }

        $productImage = Subbly::api('subbly.product_image')->update($uid, array(
            'image' => Input::file('product_image'),
        ));

        return $this->jsonResponse(array(
            'product_image' => $productImage,
        ),
        array(
            'status' => array(
                'code'    => 200,
                'message' => 'ProductImage updated',
            ),
        ));
    }
277331
public function createProductAttribute(
        Attribute $attribute,
        ProductInterface $product,
        AttributeValue $attributeValue
    ) {
        $productAttribute = $this->productAttributeRepository->createNew();
        $productAttribute->setAttribute($attribute);
        $productAttribute->setProduct($product);
        $productAttribute->setAttributeValue($attributeValue);
        $this->entityManager->persist($productAttribute);

        $product->addProductAttribute($productAttribute);

        return $productAttribute;
    }
227275
public function editProductBundle($product_id)
    {
        $this->setProductProductBundle($product_id);
        $this->setTitleEditProductBundle();
        $this->setBreadcrumbEditProductBundle();

        $this->setData('product', $this->data_product);

        $this->submitEditProductBundle();
        $this->setDataItemsProductBundle();
        $this->outputEditProductBundle();
    }
232675
public function generate(string $entryIdentifier, string $fileName, string $data)
    {
        foreach ($this->getImplementationObjects() as $implementation) {
            /* @var $implementation AbstractGenerator */
            $implementation->generate($entryIdentifier, $fileName, $data);
        }
    }