Class CategoryWriteService
This class provides methods for creating, updating and deleting categories data.
| category |
System |
|---|---|
| package |
Category |
| implements |
CategoryWriteServiceInterface |
__construct(\CategoryRepositoryInterface $categoryRepo, \AbstractFileStorage $categoryImageStorage, \AbstractFileStorage $categoryIconStorage, \AbstractFileStorage $categoryOpenGraphImageStorage, \ProductPermissionSetterInterface $productPermissionSetter, \UrlKeywordsRepairerInterface $urlKeywordsRepairer, \CacheControl $cacheControl)
\CacheControlUsed to reset category cache.
activateCategory(\IdType $categoryId, \BoolType $includeSubcategories) : \CategoryWriteServiceInterface
createCategory(\CategoryInterface $category) : integer
integerReturns the ID of the new category record.
deactivateCategory(\IdType $categoryId, \BoolType $includeSubcategories) : \CategoryWriteServiceInterface
deleteCategoryById(\IdType $categoryId) : \CategoryWriteService
deleteCategoryIconFile(\FilenameStringType $filename) : \CategoryWriteServiceInterface
deleteCategoryImageFile(\FilenameStringType $filename) : \CategoryWriteServiceInterface
deleteCategoryOpenGraphImageFile(\FilenameStringType $filename) : \CategoryWriteServiceInterface
duplicateCategory(\IdType $categoryId, \IdType $targetParentId, \BoolType $duplicateProducts = null, \BoolType $duplicateAttributes = null, \BoolType $duplicateSpecials = null, \BoolType $duplicateCrossSelling = null) : integer
This method duplicates the category which are identified by the provided category ID and links the duplicated category with the provided parent category ID. Containing subcategories and products will also be recursively duplicated with their attributes, specials and cross selling data depending on the last four arguments.
| todo |
Implement the last four arguments when finished in UML. |
|---|
integerReturns the ID of the new category record.
importCategoryIconFile(\ExistingFile $sourceFile, \FilenameStringType $saveAsFilename) : string
stringThe new filename.
importCategoryImageFile(\ExistingFile $sourceFile, \FilenameStringType $saveAsFilename) : string
stringThe new filename.
importCategoryOpenGraphImageFile(\ExistingFile $sourceFile, \FilenameStringType $saveAsFilename) : string
stringThe new filename.
moveCategory(\IdType $categoryId, \IdType $newParentId) : \CategoryWriteService
This method moves a category specified by its category ID into another parent category specified by its category ID.
\CategoryWriteServiceSame instance for chained method calls.
renameCategoryIconFile(\FilenameStringType $oldName, \FilenameStringType $newName) : \CategoryWriteServiceInterface
renameCategoryImageFile(\FilenameStringType $oldName, \FilenameStringType $newName) : \CategoryWriteServiceInterface
renameCategoryOpenGraphImageFile(\FilenameStringType $oldName, \FilenameStringType $newName) : \CategoryWriteServiceInterface
setCustomerStatusPermission(\IdType $categoryId, \IdType $customerStatusId, \BoolType $permitted, \BoolType $includeSubcategoriesAndProducts) : \CategoryWriteServiceInterface
The customer status permissions decides if the category is visible for a specific customer group. The permissions can be applied for subcategories also if desired.
\CategoryWriteServiceInterfaceSame instance for chained method calls.
updateCategory(\StoredCategoryInterface $category) : \CategoryWriteService
categoryRepo : \CategoryRepositoryInterface
categoryOpenGraphImageStorage : \AbstractFileStorage
productPermissionSetter : \ProductPermissionSetterInterface
urlKeywordsRepairer : \UrlKeywordsRepairerInterface
cacheControl : \CacheControl
| var |
|---|
\CacheControl