Class ProductWriteService
category |
System |
---|---|
package |
Product |
__construct(\ProductRepositoryInterface $productRepo, \AbstractFileStorage $productImageStorage, \ProductCategoryLinkerInterface $productLinker, \ProductImagePathsSettingsInterface $envProductImagePathsSettings, \LanguageProviderInterface $languageProvider, \UrlKeywordsRepairerInterface $urlKeywordsRepairer, \DeleteHistoryWriteService $deleteHistoryService)
\ProductRepositoryInterface
\AbstractFileStorage
\ProductCategoryLinkerInterface
\ProductImagePathsSettingsInterface
\LanguageProviderInterface
\UrlKeywordsRepairerInterface
\DeleteHistoryWriteService
changeProductLink(\IdType $productId, \IdType $currentCategoryId, \IdType $newCategoryId) : \ProductWriteService
createProduct(\ProductInterface $product) : integer
Creates a new product and returns the ID of it.
Throws |
|
---|
integer
The ID of the created product.
deleteProductById(\IdType $productId) : \ProductWriteServiceInterface
Deletes a specific product, depending on the provided product ID.
\ProductWriteServiceInterface
Same instance for chained method calls.
deleteProductImage(\FilenameStringType $filename) : \ProductWriteService
Deletes a product image.
\ProductWriteService
Same 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.
todo |
Implement the last three arguments when finished in UML. |
---|---|
Throws |
|
integer
Returns the ID of the new product.
duplicateProductImage(\ProductImageInterface $sourceProductImage) : \ProductImageInterface
importProductImageFile(\ExistingFile $sourceFile, \FilenameStringType $preferredFilename) : string
Imports an image for the product.
Throws |
|
---|
string
The new filename.
linkProduct(\IdType $productId, \IdType $targetCategoryId) : \ProductWriteService
Links a product to a category.
\ProductWriteService
Same instance for chained method calls.
processProductImage(\FilenameStringType $productImage) : \ProductWriteService
\FilenameStringType
\ProductWriteService
Same instance for chained method calls.
renameProductImage(\FilenameStringType $oldName, \FilenameStringType $newName) : \ProductWriteService
Renames a product image file.
Throws |
|
---|
\ProductWriteService
Same instance for chained method calls.
unlinkProduct(\IdType $productId, \IdCollection $categoryIds) : \ProductWriteServiceInterface|$this
Deletes the product if all category links are removed.
\ProductWriteServiceInterface|$this
Same instance for chained method calls.
updateProduct(\StoredProductInterface $product, \stdClass $rawProduct = null) : \ProductWriteServiceInterface
Updates a stored product.
\stdClass
\ProductWriteServiceInterface
Same instance for chained method calls.
productRepo : \ProductRepositoryInterface
productImageStorage : \AbstractFileStorage
productLinker : \ProductCategoryLinkerInterface
envProductImagePathsSettings : \ProductImagePathsSettingsInterface
languageProvider : \LanguageProviderInterface
urlKeywordsRepairer : \UrlKeywordsRepairerInterface
deleteHistoryService : \DeleteHistoryWriteService