1 <?php
2
3 /* --------------------------------------------------------------
4 CategoryRepositoryWriterInterface.php 2015-11-23
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 CategoryRepositoryWriterInterface
15 *
16 * This interface defines methods for creating and updating specific category records in the database and is used in the category
17 * repository among the interfaces for reading and deleting category records.
18 *
19 * @category System
20 * @package Category
21 * @subpackage Interfaces
22 */
23 interface CategoryRepositoryWriterInterface
24 {
25 /**
26 * Inserts a category record into the database accordingly to the provided category object and returns the ID from
27 * the saved entity.
28 *
29 * @param CategoryInterface $category The category to insert.
30 *
31 * @return int Returns the ID of the new category.
32 */
33 public function insert(CategoryInterface $category);
34
35
36 /**
37 * Updates an existing category record accordingly to the provided category object.
38 *
39 * @param StoredCategoryInterface $category The category to update.
40 *
41 * @return CategoryRepositoryWriterInterface Same instance for chained method calls.
42 */
43 public function update(StoredCategoryInterface $category);
44 }