1 <?php
2
3 /* --------------------------------------------------------------
4 ProductCategoryLinkerInterface.inc.php 2016-01-28
5 Gambio GmbH
6 http://www.gambio.de
7 Copyright (c) 2016 Gambio GmbH
8 Released under the GNU General Public License (Version 2)
9 [http://www.gnu.org/licenses/gpl-2.0.html]
10 --------------------------------------------------------------
11 */
12
13 /**
14 * Interface ProductCategoryLinkerInterface
15 *
16 * @category System
17 * @package Product
18 * @subpackage Interfaces
19 */
20 interface ProductCategoryLinkerInterface
21 {
22 /**
23 * Links a product to a category.
24 *
25 * @param IdType $productId Product ID.
26 *
27 * @param IdType $targetCategoryId Target category ID.
28 *
29 * @return $this|ProductCategoryLinkerInterface Same instance for chained method calls.
30 */
31 public function linkProduct(IdType $productId, IdType $targetCategoryId);
32
33
34 /**
35 * Changes a link to a new category.
36 *
37 * @param IdType $productId Product ID.
38 * @param IdType $currentCategoryId Category ID which the product is linked to.
39 * @param IdType $newCategoryId New category to be linked to.
40 *
41 * @return $this|ProductCategoryLinkerInterface Same instance for chained method calls.
42 */
43 public function changeProductLink(IdType $productId, IdType $currentCategoryId, IdType $newCategoryId);
44
45
46 /**
47 * Removes a link to a category.
48 *
49 * @param IdType $productId Product ID.
50 * @param IdType $categoryId Category ID which the link should be removed to.
51 *
52 * @return $this|ProductCategoryLinkerInterface Same instance for chained method calls.
53 */
54 public function deleteProductLink(IdType $productId, IdType $categoryId);
55
56
57 /**
58 * Removes all links from a product.
59 *
60 * @param IdType $productId Product ID.
61 *
62 * @return $this|ProductCategoryLinkerInterface Same instance for chained method calls.
63 */
64 public function deleteProductLinks(IdType $productId);
65
66
67 /**
68 * Returns the category Ids which are linked with given product id.
69 *
70 * @param IdType $productId
71 *
72 * @return IdCollection
73 */
74 public function getProductLinks(IdType $productId);
75 }