1 <?php
2
3 /* --------------------------------------------------------------
4 ProductRepositoryInterface.inc.php 2015-12-08
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 ProductRepositoryInterface
15 *
16 * @category System
17 * @package Product
18 * @subpackage Interfaces
19 */
20 interface ProductRepositoryInterface
21 {
22 /**
23 * Adds a new product in the database.
24 *
25 * @param ProductInterface $product Product entity which holds the values for the database columns.
26 *
27 * @return int Id of inserted product.
28 */
29 public function add(ProductInterface $product);
30
31
32 /**
33 * Updates an existing product in the database.
34 *
35 * @param StoredProductInterface $product Product entity to update.
36 *
37 * @return ProductRepositoryInterface|$this Same instance for chained method calls.
38 */
39 public function store(StoredProductInterface $product);
40
41
42 /**
43 * Returns a stored product by the given id.
44 *
45 * @param IdType $productId Id of expected product entity.
46 *
47 * @return StoredProductInterface Product entity with the expected product id.
48 */
49 public function getProductById(IdType $productId);
50
51
52 /**
53 * Removes a product from the database by the given id.
54 *
55 * @param IdType $productId Id of expected product entity.
56 *
57 * @return ProductRepositoryInterface|$this Same instance for chained method calls.
58 */
59 public function deleteProductById(IdType $productId);
60 }