1 <?php
2
3 /* --------------------------------------------------------------
4 CategoryRepositoryInterface.inc.php 2016-01-29
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 CategoryRepositoryInterface
15 *
16 * This interface defines methods for handling the database operations that concern the category records of the
17 * database. It provides a layer for more complicated methods that use the writer, reader and deleter.
18 *
19 * @category System
20 * @package Category
21 * @subpackage Interfaces
22 */
23 interface CategoryRepositoryInterface
24 {
25 /**
26 * Adds a category.
27 *
28 * @param CategoryInterface $category Category to add.
29 *
30 * @return int Stored id of the passed category.
31 */
32 public function add(CategoryInterface $category);
33
34
35 /**
36 * Stores a category.
37 *
38 * @param StoredCategoryInterface $category Stored category.
39 *
40 * @return CategoryRepositoryInterface Same instance for chained method calls.
41 */
42 public function store(StoredCategoryInterface $category);
43
44
45 /**
46 * Gets a category by the given ID.
47 *
48 * @param IdType $categoryId Category ID.
49 *
50 * @return StoredCategoryInterface
51 */
52 public function getCategoryById(IdType $categoryId);
53
54
55 /**
56 * Deletes a category by the given ID.
57 *
58 * @param IdType $categoryId Category ID.
59 *
60 * @return CategoryRepositoryInterface Same instance for chained method calls.
61 */
62 public function deleteCategoryById(IdType $categoryId);
63
64
65 /**
66 * Returns all Categories with the provided parent ID.
67 *
68 * @param IdType $parentId
69 *
70 * @return IdCollection
71 */
72 public function getCategoryIdsByParentId(IdType $parentId);
73 }