1 <?php
2 /* --------------------------------------------------------------
3 ProductAttributeServiceInterface.inc.php 2016-01-18
4 Gambio GmbH
5 http://www.gambio.de
6 Copyright (c) 2016 Gambio GmbH
7 Released under the GNU General Public License (Version 2)
8 [http://www.gnu.org/licenses/gpl-2.0.html]
9 --------------------------------------------------------------
10 */
11
12 /**
13 * Interface ProductAttributeServiceInterface
14 *
15 * @category System
16 * @package ProductModule
17 * @subpackage Interfaces
18 */
19 interface ProductAttributeServiceInterface
20 {
21 /**
22 * Adds an product attribute to a product by the given id.
23 *
24 * @param IdType $productId Id of product entity that adds the attribute.
25 * @param ProductAttributeInterface $attribute Product attribute entity to add.
26 *
27 * @return int Id of inserted product attribute.
28 */
29 public function addAttribute(IdType $productId, ProductAttributeInterface $attribute);
30
31
32 /**
33 * Updates the passed product attribute entity.
34 *
35 * @param StoredProductAttributeInterface $attribute Product attribute entity to update.
36 *
37 * @return $this|ProductAttributeServiceInterface Same instance for chained method calls.
38 */
39 public function updateAttribute(StoredProductAttributeInterface $attribute);
40
41
42 /**
43 * Returns a stored product attribute entity by the given product attribute id.
44 *
45 * @param IdType $productAttributeId Id of expected product attribute entity.
46 *
47 * @return StoredProductAttributeInterface Expected stored product attribute entity.
48 */
49 public function getAttributeById(IdType $productAttributeId);
50
51
52 /**
53 * Returns a collection with all attribute entities that belongs to a product entity by the given product id.
54 *
55 * @param IdType $productId Id of product entity that contain the expected attributes.
56 *
57 * @return StoredProductAttributeCollection Collection with all attributes that belongs to the product.
58 */
59 public function getAttributesByProductId(IdType $productId);
60
61
62 /**
63 * Removes a product attribute entity by the given product attribute id.
64 *
65 * @param IdType $productAttributeId Id of product attribute entity that should be deleted.
66 *
67 * @return ProductAttributeServiceInterface|$this Same instance for chained method calls.
68 */
69 public function removeAttributeById(IdType $productAttributeId);
70
71
72 /**
73 * Removes product attributes by the given product id.
74 *
75 * @param IdType $productId Id of product entity of the attributes that should be deleted.
76 *
77 * @return ProductAttributeServiceInterface|$this Same instance for chained method calls.
78 */
79 public function removeAttributesByProductId(IdType $productId);
80 }