CategoryWriteServiceInterface

Extends

Interface CategoryWriteServiceInterface

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

category

System

package

Category

subpackage

Interfaces

Methods

Activates a specific category and its subcategories if desired.

activateCategory(\IdType $categoryId, \BoolType $includeSubcategories) : \CategoryWriteServiceInterface

Arguments

$categoryId

\IdType

Category ID of the category to activate.

$includeSubcategories

\BoolType

Shall the subcategories be activated also?

Response

\CategoryWriteServiceInterface

Same instance for chained method calls.

Creates a category and returns the ID of it.

createCategory(\CategoryInterface $category) : integer

Arguments

$category

\CategoryInterface

The category to create.

Response

integer

Returns the ID of the new category record.

Deactivates a specific category and its subcategories if desired.

deactivateCategory(\IdType $categoryId, \BoolType $includeSubcategories) : \CategoryWriteServiceInterface

Arguments

$categoryId

\IdType

Category ID of the category to deactivate.

$includeSubcategories

\BoolType

Shall the subcategories be deactivated also?

Response

\CategoryWriteServiceInterface

Same instance for chained method calls.

Deletes a category depending on the provided category ID.

deleteCategoryById(\IdType $categoryId) : \CategoryWriteServiceInterface

Arguments

$categoryId

\IdType

Category ID of the category to delete.

Response

\CategoryWriteServiceInterface

Same instance for chained method calls.

Deletes a category icon file.

deleteCategoryIconFile(\FilenameStringType $filename) : \CategoryWriteServiceInterface

Arguments

$filename

\FilenameStringType

Category icon filename.

Response

\CategoryWriteServiceInterface

Same instance for chained method calls.

Deletes a category image file.

deleteCategoryImageFile(\FilenameStringType $filename) : \CategoryWriteServiceInterface

Arguments

$filename

\FilenameStringType

Category image filename.

Response

\CategoryWriteServiceInterface

Same instance for chained method calls.

Duplicates a category specified by its category ID.

duplicateCategory(\IdType $categoryId, \IdType $targetParentId, \BoolType $duplicateProducts, \BoolType $duplicateAttributes, \BoolType $duplicateSpecials, \BoolType $duplicateCrossSelling) : 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.

Arguments

$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?

Response

integer

Returns the ID of the new category record.

Imports an icon file and stores it.

importCategoryIconFile(\ExistingFile $sourceFile, \FilenameStringType $saveAsFilename) : string

Arguments

$sourceFile

\ExistingFile

The icon file to import.

$saveAsFilename

\FilenameStringType

The name under which the icon should be stored.

Response

string

The new filename.

Imports an image file and stores it.

importCategoryImageFile(\ExistingFile $sourceFile, \FilenameStringType $saveAsFilename) : string

Arguments

$sourceFile

\ExistingFile

The image file to import.

$saveAsFilename

\FilenameStringType

The name under which the image should to be stored.

Response

string

The new filename.

Moves a category into another category.

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.

Arguments

$categoryId

\IdType

Category ID of the category to move.

$newParentId

\IdType

The new parent ID.

Response

\CategoryWriteServiceInterface

Same instance for chained method calls.

Renames a category icon file.

renameCategoryIconFile(\FilenameStringType $oldName, \FilenameStringType $newName) : \CategoryWriteServiceInterface

Arguments

$oldName

\FilenameStringType

Old filename.

$newName

\FilenameStringType

New filename.

Response

\CategoryWriteServiceInterface

Same instance for chained method calls.

Renames a category image file.

renameCategoryImageFile(\FilenameStringType $oldName, \FilenameStringType $newName) : \CategoryWriteServiceInterface

Arguments

$oldName

\FilenameStringType

Old filename.

$newName

\FilenameStringType

New filename.

Response

\CategoryWriteServiceInterface

Same instance for chained method calls.

Sets the customer status permissions.

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.

Arguments

$categoryId

\IdType

Category ID.

$customerStatusId

\IdType

Customer status ID.

$permitted

\BoolType

Grant permission?

$includeSubcategoriesAndProducts

\BoolType

Grant permission including subcategories?

Response

\CategoryWriteServiceInterface

Same instance for chained method calls.

Updates the provided category and returns itself.

updateCategory(\StoredCategoryInterface $category) : \CategoryWriteServiceInterface

Arguments

$category

\StoredCategoryInterface

The category to update.

Response

\CategoryWriteServiceInterface

Same instance for chained method calls.