1 | <?php |
||
18 | abstract class GeneralCurdable extends AbstractManager |
||
19 | { |
||
20 | /** |
||
21 | * Finds the resources by given query condition. |
||
22 | * |
||
23 | * @param array $query |
||
24 | * |
||
25 | * @return ModelInterface[] |
||
26 | */ |
||
27 | public function findAll(array $query = []) |
||
33 | |||
34 | /** |
||
35 | * Create a paging query. |
||
36 | * |
||
37 | * @param array $query |
||
38 | * |
||
39 | * @return CursorBasedPagination |
||
40 | * @codeCoverageIgnore |
||
41 | */ |
||
42 | public function paginate(array $query = []) |
||
48 | |||
49 | /** |
||
50 | * Finds the resource by given id. |
||
51 | * |
||
52 | * @param int $id |
||
53 | * |
||
54 | * @return ModelInterface |
||
55 | */ |
||
56 | public function find($id) |
||
62 | |||
63 | /** |
||
64 | * Delete a resource. |
||
65 | * |
||
66 | * @param int $id |
||
67 | */ |
||
68 | public function remove($id) |
||
72 | |||
73 | /** |
||
74 | * Updates a resource. |
||
75 | * |
||
76 | * @param int $id |
||
77 | * @param array $data |
||
78 | * |
||
79 | * @return ModelInterface |
||
80 | */ |
||
81 | public function update($id, array $data) |
||
87 | |||
88 | /** |
||
89 | * Creates a resource. |
||
90 | * |
||
91 | * @param array $data |
||
92 | * |
||
93 | * @return ModelInterface |
||
94 | */ |
||
95 | public function create(array $data) |
||
101 | |||
102 | /** |
||
103 | * Gets the number of resource with given query. |
||
104 | * |
||
105 | * @param array $query |
||
106 | * |
||
107 | * @return int |
||
108 | */ |
||
109 | public function count(array $query = []) |
||
115 | } |