1 <?php
2
3 /* --------------------------------------------------------------
4 ProductAttributeRepositoryInterface.inc.php 2016-01-07
5 Gambio GmbH
6 http://www.gambio.de
7 Copyright (c) 2015 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 ProductAttributeRepositoryInterface
15 *
16 * @category System
17 * @package ProductModule
18 * @subpackage Interface
19 */
20 interface ProductAttributeRepositoryInterface
21 {
22 /**
23 * Adds an product attribute to a product by the given id.
24 *
25 * @param IdType $productId Id of product entity that adds the attribute.
26 * @param ProductAttributeInterface $productAttribute Product attribute entity to add.
27 *
28 * @return int Id of added product attribute entity.
29 */
30 public function addToProduct(IdType $productId, ProductAttributeInterface $productAttribute);
31
32
33 /**
34 * Stores/Updates the passed product attribute entity.
35 *
36 * @param StoredProductAttributeInterface $productAttribute Product attribute entity to store.
37 *
38 * @return ProductAttributeRepositoryInterface|$this Same instance for chained method calls.
39 */
40 public function store(StoredProductAttributeInterface $productAttribute);
41
42
43 /**
44 * Returns a stored product attribute entity by the given product attribute id.
45 *
46 * @param IdType $productAttributeId Id of expected product attribute entity.
47 *
48 * @return StoredProductAttributeInterface Expected stored product attribute entity.
49 */
50 public function getAttributeById(IdType $productAttributeId);
51
52
53 /**
54 * Returns a collection with all attribute entities that belongs to a product entity by the given product id.
55 *
56 * @param IdType $productId Id of product entity that contain the expected attributes.
57 *
58 * @return StoredProductAttributeCollection Collection with all attributes that belongs to the product.
59 */
60 public function getAttributesByProductId(IdType $productId);
61
62
63 /**
64 * Removes a product attribute entity by the given product attribute id.
65 *
66 * @param IdType $productAttributeId Id of product attribute entity that should be deleted.
67 *
68 * @return ProductAttributeRepositoryInterface|$this Same instance for chained method calls.
69 */
70 public function deleteAttributeById(IdType $productAttributeId);
71
72
73 /**
74 * Removes product attributes by the given product id.
75 *
76 * @param IdType $productId Id of product entity of the attributes that should be deleted.
77 *
78 * @return ProductAttributeRepositoryInterface|$this Same instance for chained method calls.
79 */
80 public function deleteAttributesByProductId(IdType $productId);
81 }