-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathRepositoryInterface.php
More file actions
112 lines (100 loc) · 2.79 KB
/
Copy pathRepositoryInterface.php
File metadata and controls
112 lines (100 loc) · 2.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?php
/**
* Copyright © Magmodules.eu. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);
namespace Magmodules\Channable\Api\Order;
use Magento\Framework\Api\SearchCriteriaInterface;
use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\Exception\NoSuchEntityException;
use Magmodules\Channable\Api\Order\Data\DataInterface as ChannableOrderData;
use Magmodules\Channable\Api\Order\Data\SearchResultsInterface;
use Magmodules\Channable\Model\Order\DataModel;
/**
* Channable Order repository interface
*/
interface RepositoryInterface
{
/**
* Input exception text
*/
public const INPUT_EXCEPTION = 'An ID is needed. Set the ID and try again.';
/**
* "No such entity" exception text
*/
public const NO_SUCH_ENTITY_EXCEPTION = 'The order with id "%1" does not exist.';
/**
* "Could not delete" exception text
*/
public const COULD_NOT_DELETE_EXCEPTION = 'Could not delete the order: %1';
/**
* "Could not save" exception text
*/
public const COULD_NOT_SAVE_EXCEPTION = 'Could not save the order: %1';
/**
* Loads a specified Return
*
* @param int $id
*
* @return ChannableOrderData
* @throws LocalizedException
*/
public function get(int $id): ChannableOrderData;
/**
* Return Channable Order object
*
* @return ChannableOrderData
*/
public function create();
/**
* Retrieves an Channable Order matching the specified criteria.
*
* @param SearchCriteriaInterface $searchCriteria
*
* @return SearchResultsInterface
* @throws LocalizedException
*/
public function getList($searchCriteria);
/**
* Register entity to delete
*
* @param DataModel $entity
*
* @return bool true on success
* @throws LocalizedException
*/
public function delete(DataModel $entity): bool;
/**
* Deletes an Channable Order entity by ID
*
* @param int $id
*
* @return bool true on success
* @throws NoSuchEntityException
* @throws LocalizedException
*/
public function deleteById($id);
/**
* Perform persist operations for one entity
*
* @param ChannableOrderData $entity
*
* @return ChannableOrderData
* @throws LocalizedException
*/
public function save(ChannableOrderData $entity): ChannableOrderData;
/**
* @param int $channableId
*
* @return int|bool
*/
public function getByChannableId(int $channableId, ?int $storeId = null);
/**
* @param array $orderData
* @param int $storeId
* @throws LocalizedException
* @return ChannableOrderData
*/
public function createByDataArray(array $orderData, int $storeId) : ChannableOrderData;
}