Class ProductWriteService
| category |
System |
|---|---|
| package |
Product |
__construct(\ProductRepositoryInterface $productRepo, \AbstractFileStorage $productImageStorage, \ProductCategoryLinkerInterface $productLinker, \ProductImagePathsSettingsInterface $envProductImagePathsSettings, \LanguageProviderInterface $languageProvider, \UrlKeywordsRepairerInterface $urlKeywordsRepairer)
\ProductRepositoryInterface
\AbstractFileStorage
\ProductCategoryLinkerInterface
\ProductImagePathsSettingsInterface
\LanguageProviderInterface
\UrlKeywordsRepairerInterface
changeProductLink(\IdType $productId, \IdType $currentCategoryId, \IdType $newCategoryId) : \ProductWriteService
createProduct(\ProductInterface $product) : integer
Creates a new product and returns the ID of it.
| throws |
Through "linkProduct" method. |
|---|
integerThe ID of the created product.
deleteProductById(\IdType $productId) : \ProductWriteServiceInterface
Deletes a specific product, depending on the provided product ID.
\ProductWriteServiceInterfaceSame instance for chained method calls.
deleteProductImage(\FilenameStringType $filename) : \ProductWriteService
Deletes a product image.
\ProductWriteServiceSame instance for chained method calls.
deleteProductLink(\IdType $productId, \IdType $categoryId) : \ProductWriteService
deleteProductLinks(\IdType $productId) : \ProductWriteService
duplicateProduct(\IdType $productId, \IdType $targetCategoryId, \BoolType $duplicateAttributes = null, \BoolType $duplicateSpecials = null, \BoolType $duplicateCrossSelling = null) : integer
Duplicates a product to a category.
| throws |
If "$newProductId" is not an integer. |
|---|---|
| todo |
Implement the last three arguments when finished in UML. |
integerReturns the ID of the new product.
duplicateProductImage(\ProductImageInterface $sourceProductImage) : \ProductImageInterface
importProductImageFile(\ExistingFile $sourceFile, \FilenameStringType $preferredFilename) : string
Imports an image for the product.
| throws |
If the provided source file or the preferred filename is not valid. |
|---|
stringThe new filename.
linkProduct(\IdType $productId, \IdType $targetCategoryId) : \ProductWriteService
Links a product to a category.
\ProductWriteServiceSame instance for chained method calls.
processProductImage(\FilenameStringType $productImage) : \ProductWriteService
\FilenameStringType
\ProductWriteServiceSame instance for chained method calls.
renameProductImage(\FilenameStringType $oldName, \FilenameStringType $newName) : \ProductWriteService
Renames a product image file.
| throws |
If the provided old name or new name is not valid. |
|---|
\ProductWriteServiceSame instance for chained method calls.
updateProduct(\StoredProductInterface $product) : \ProductWriteServiceInterface
Updates a stored product.
\ProductWriteServiceInterfaceSame instance for chained method calls.
productRepo : \ProductRepositoryInterface
productImageStorage : \AbstractFileStorage
productLinker : \ProductCategoryLinkerInterface
envProductImagePathsSettings : \ProductImagePathsSettingsInterface
languageProvider : \LanguageProviderInterface
urlKeywordsRepairer : \UrlKeywordsRepairerInterface