phpDocumentor

CategoryWriteServiceInterface

Interface CategoryWriteServiceInterface

This interface defines methods for creating, updating and deleting categories data.

Tags
category

System

subpackage

Interfaces

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

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.

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
$categoryId : IdType

Category ID of the category to move.

$newParentId : IdType

The new parent ID.

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.

Search results