1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
<?php
/* --------------------------------------------------------------
CategoryWriteServiceInterface.inc.php 2016-02-15
Gambio GmbH
http://www.gambio.de
Copyright (c) 2016 Gambio GmbH
Released under the GNU General Public License (Version 2)
[http://www.gnu.org/licenses/gpl-2.0.html]
--------------------------------------------------------------
*/
/**
* Interface CategoryWriteServiceInterface
*
* This interface defines methods for creating, updating and deleting categories data.
*
* @category System
* @package Category
* @subpackage Interfaces
*/
interface CategoryWriteServiceInterface
{
/**
* Creates a category and returns the ID of it.
*
* @param CategoryInterface $category The category to create.
*
* @return int Returns the ID of the new category record.
*/
public function createCategory(CategoryInterface $category);
/**
* Updates the provided category and returns itself.
*
* @param StoredCategoryInterface $category The category to update.
*
* @return CategoryWriteServiceInterface Same instance for chained method calls.
*/
public function updateCategory(StoredCategoryInterface $category);
/**
* Deletes a category depending on the provided category ID.
*
* @param IdType $categoryId Category ID of the category to delete.
*
* @return CategoryWriteServiceInterface Same instance for chained method calls.
*/
public function deleteCategoryById(IdType $categoryId);
/**
* Moves a category into another category.
*
* This method moves a category specified by its category ID into another parent category specified by its
* category ID.
*
* @param IdType $categoryId Category ID of the category to move.
* @param IdType $newParentId The new parent ID.
*
* @return CategoryWriteServiceInterface Same instance for chained method calls.
*/
public function moveCategory(IdType $categoryId, IdType $newParentId);
/**
* Duplicates a category specified by its category ID.
*
* 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.
*
* @param IdType $categoryId The category ID of the category to duplicate.
* @param IdType $targetParentId The target parent ID of the duplicated category.
* @param BoolType $duplicateProducts Should the products be duplicated?
* @param BoolType $duplicateAttributes Should the attributes be duplicated?
* @param BoolType $duplicateSpecials Should the specials be duplicated?
* @param BoolType $duplicateCrossSelling Should cross selling be duplicated?
*
* @return int Returns the ID of the new category record.
*/
public function duplicateCategory(IdType $categoryId,
IdType $targetParentId,
BoolType $duplicateProducts,
BoolType $duplicateAttributes,
BoolType $duplicateSpecials,
BoolType $duplicateCrossSelling);
/**
* Imports an image file and stores it.
*
* @param ExistingFile $sourceFile The image file to import.
* @param FilenameStringType $saveAsFilename The name under which the image should to be stored.
*
* @return string The new filename.
*/
public function importCategoryImageFile(ExistingFile $sourceFile, FilenameStringType $saveAsFilename);
/**
* Imports an icon file and stores it.
*
* @param ExistingFile $sourceFile The icon file to import.
* @param FilenameStringType $saveAsFilename The name under which the icon should be stored.
*
* @return string The new filename.
*/
public function importCategoryIconFile(ExistingFile $sourceFile, FilenameStringType $saveAsFilename);
/**
* Renames a category image file.
*
* @param FilenameStringType $oldName Old filename.
* @param FilenameStringType $newName New filename.
*
* @return CategoryWriteServiceInterface Same instance for chained method calls.
*/
public function renameCategoryImageFile(FilenameStringType $oldName, FilenameStringType $newName);
/**
* Renames a category icon file.
*
* @param FilenameStringType $oldName Old filename.
* @param FilenameStringType $newName New filename.
*
* @return CategoryWriteServiceInterface Same instance for chained method calls.
*/
public function renameCategoryIconFile(FilenameStringType $oldName, FilenameStringType $newName);
/**
* Deletes a category image file.
*
* @param FilenameStringType $filename Category image filename.
*
* @return CategoryWriteServiceInterface Same instance for chained method calls.
*/
public function deleteCategoryImageFile(FilenameStringType $filename);
/**
* Deletes a category icon file.
*
* @param FilenameStringType $filename Category icon filename.
*
* @return CategoryWriteServiceInterface Same instance for chained method calls.
*/
public function deleteCategoryIconFile(FilenameStringType $filename);
/**
* Activates a specific category and its subcategories if desired.
*
* @param IdType $categoryId Category ID of the category to activate.
* @param BoolType $includeSubcategories Shall the subcategories be activated also?
*
* @return CategoryWriteServiceInterface Same instance for chained method calls.
*/
public function activateCategory(IdType $categoryId, BoolType $includeSubcategories);
/**
* Deactivates a specific category and its subcategories if desired.
*
* @param \IdType $categoryId Category ID of the category to deactivate.
* @param \BoolType $includeSubcategories Shall the subcategories be deactivated also?
*
* @return CategoryWriteServiceInterface Same instance for chained method calls.
*/
public function deactivateCategory(IdType $categoryId, BoolType $includeSubcategories);
/**
* Sets the customer status permissions.
*
* 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.
*
* @param \IdType $categoryId Category ID.
* @param \IdType $customerStatusId Customer status ID.
* @param \BoolType $permitted Grant permission?
* @param \BoolType $includeSubcategoriesAndProducts Grant permission including subcategories?
*
* @return CategoryWriteServiceInterface Same instance for chained method calls.
*/
public function setCustomerStatusPermission(IdType $categoryId,
IdType $customerStatusId,
BoolType $permitted,
BoolType $includeSubcategoriesAndProducts);
}