CategoryWriteServiceInterface
in
Interface CategoryWriteServiceInterface
This interface defines methods for creating, updating and deleting categories data.
Tags
Table of Contents
- activateCategory() : CategoryWriteServiceInterface
- Activates a specific category and its subcategories if desired.
- createCategory() : int
- Creates a category and returns the ID of it.
- deactivateCategory() : CategoryWriteServiceInterface
- Deactivates a specific category and its subcategories if desired.
- deleteCategoryById() : CategoryWriteServiceInterface
- Deletes a category depending on the provided category ID.
- deleteCategoryIconFile() : CategoryWriteServiceInterface
- Deletes a category icon file.
- deleteCategoryImageFile() : CategoryWriteServiceInterface
- Deletes a category image file.
- duplicateCategory() : int
- Duplicates a category specified by its category ID.
- importCategoryIconFile() : string
- Imports an icon file and stores it.
- importCategoryImageFile() : string
- Imports an image file and stores it.
- moveCategory() : CategoryWriteServiceInterface
- Moves a category into another category.
- renameCategoryIconFile() : CategoryWriteServiceInterface
- Renames a category icon file.
- renameCategoryImageFile() : CategoryWriteServiceInterface
- Renames a category image file.
- setCustomerStatusPermission() : CategoryWriteServiceInterface
- Sets the customer status permissions.
- updateCategory() : CategoryWriteServiceInterface
- Updates the provided category and returns itself.
Methods
activateCategory()
Activates a specific category and its subcategories if desired.
public
activateCategory(IdType $categoryId, BoolType $includeSubcategories) : CategoryWriteServiceInterface
Parameters
- $categoryId : IdType
-
Category ID of the category to activate.
- $includeSubcategories : BoolType
-
Shall the subcategories be activated also?
Return values
CategoryWriteServiceInterface —Same instance for chained method calls.
createCategory()
Creates a category and returns the ID of it.
public
createCategory(CategoryInterface $category) : int
Parameters
- $category : CategoryInterface
-
The category to create.
Return values
int —Returns the ID of the new category record.
deactivateCategory()
Deactivates a specific category and its subcategories if desired.
public
deactivateCategory(IdType $categoryId, BoolType $includeSubcategories) : CategoryWriteServiceInterface
Parameters
- $categoryId : IdType
-
Category ID of the category to deactivate.
- $includeSubcategories : BoolType
-
Shall the subcategories be deactivated also?
Return values
CategoryWriteServiceInterface —Same instance for chained method calls.
deleteCategoryById()
Deletes a category depending on the provided category ID.
public
deleteCategoryById(IdType $categoryId) : CategoryWriteServiceInterface
Parameters
- $categoryId : IdType
-
Category ID of the category to delete.
Return values
CategoryWriteServiceInterface —Same instance for chained method calls.
deleteCategoryIconFile()
Deletes a category icon file.
public
deleteCategoryIconFile(FilenameStringType $filename) : CategoryWriteServiceInterface
Parameters
- $filename : FilenameStringType
-
Category icon filename.
Return values
CategoryWriteServiceInterface —Same instance for chained method calls.
deleteCategoryImageFile()
Deletes a category image file.
public
deleteCategoryImageFile(FilenameStringType $filename) : CategoryWriteServiceInterface
Parameters
- $filename : FilenameStringType
-
Category image filename.
Return values
CategoryWriteServiceInterface —Same instance for chained method calls.
duplicateCategory()
Duplicates a category specified by its category ID.
public
duplicateCategory(IdType $categoryId, IdType $targetParentId, BoolType $duplicateProducts, BoolType $duplicateAttributes, BoolType $duplicateSpecials, BoolType $duplicateCrossSelling) : int
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.
Parameters
- $categoryId : IdType
-
The category ID of the category to duplicate.
- $targetParentId : IdType
-
The target parent ID of the duplicated category.
- $duplicateProducts : BoolType
-
Should the products be duplicated?
- $duplicateAttributes : BoolType
-
Should the attributes be duplicated?
- $duplicateSpecials : BoolType
-
Should the specials be duplicated?
- $duplicateCrossSelling : BoolType
-
Should cross selling be duplicated?
Return values
int —Returns the ID of the new category record.
importCategoryIconFile()
Imports an icon file and stores it.
public
importCategoryIconFile(ExistingFile $sourceFile, FilenameStringType $saveAsFilename) : string
Parameters
- $sourceFile : ExistingFile
-
The icon file to import.
- $saveAsFilename : FilenameStringType
-
The name under which the icon should be stored.
Return values
string —The new filename.
importCategoryImageFile()
Imports an image file and stores it.
public
importCategoryImageFile(ExistingFile $sourceFile, FilenameStringType $saveAsFilename) : string
Parameters
- $sourceFile : ExistingFile
-
The image file to import.
- $saveAsFilename : FilenameStringType
-
The name under which the image should to be stored.
Return values
string —The new filename.
moveCategory()
Moves a category into another category.
public
moveCategory(IdType $categoryId, IdType $newParentId) : CategoryWriteServiceInterface
This method moves a category specified by its category ID into another parent category specified by its category ID.
Parameters
Return values
CategoryWriteServiceInterface —Same instance for chained method calls.
renameCategoryIconFile()
Renames a category icon file.
public
renameCategoryIconFile(FilenameStringType $oldName, FilenameStringType $newName) : CategoryWriteServiceInterface
Parameters
- $oldName : FilenameStringType
-
Old filename.
- $newName : FilenameStringType
-
New filename.
Return values
CategoryWriteServiceInterface —Same instance for chained method calls.
renameCategoryImageFile()
Renames a category image file.
public
renameCategoryImageFile(FilenameStringType $oldName, FilenameStringType $newName) : CategoryWriteServiceInterface
Parameters
- $oldName : FilenameStringType
-
Old filename.
- $newName : FilenameStringType
-
New filename.
Return values
CategoryWriteServiceInterface —Same instance for chained method calls.
setCustomerStatusPermission()
Sets the customer status permissions.
public
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.
Parameters
- $categoryId : IdType
-
Category ID.
- $customerStatusId : IdType
-
Customer status ID.
- $permitted : BoolType
-
Grant permission?
- $includeSubcategoriesAndProducts : BoolType
-
Grant permission including subcategories?
Return values
CategoryWriteServiceInterface —Same instance for chained method calls.
updateCategory()
Updates the provided category and returns itself.
public
updateCategory(StoredCategoryInterface $category) : CategoryWriteServiceInterface
Parameters
- $category : StoredCategoryInterface
-
The category to update.
Return values
CategoryWriteServiceInterface —Same instance for chained method calls.