1 | <?php |
||
11 | abstract class CrudServiceRestResourceController extends AbstractRestResourceController |
||
12 | { |
||
13 | /** |
||
14 | * {@inheritdoc} |
||
15 | */ |
||
16 | 6 | protected function listEntities(int $page = 1, int $perPage = 50) |
|
20 | |||
21 | /** |
||
22 | * {@inheritdoc} |
||
23 | */ |
||
24 | 56 | protected function fetchEntity($id) |
|
33 | |||
34 | /** |
||
35 | * {@inheritdoc} |
||
36 | */ |
||
37 | 10 | protected function createEntity($entity) |
|
41 | |||
42 | /** |
||
43 | * {@inheritdoc} |
||
44 | */ |
||
45 | 10 | protected function updateEntity($entity) |
|
49 | |||
50 | /** |
||
51 | * {@inheritdoc} |
||
52 | */ |
||
53 | 2 | protected function removeEntity($entity) |
|
57 | |||
58 | /** |
||
59 | * {@inheritdoc} |
||
60 | */ |
||
61 | 6 | protected function listSubresource($entity, string $subresource, int $page = 1, int $perPage = 50) |
|
65 | |||
66 | /** |
||
67 | * {@inheritdoc} |
||
68 | */ |
||
69 | 2 | protected function createAssociation($parent, string $subresource, $entity) |
|
73 | |||
74 | /** |
||
75 | * {@inheritdoc} |
||
76 | */ |
||
77 | 12 | protected function addAssociation($parent, string $subresource, $subId) |
|
81 | |||
82 | /** |
||
83 | * {@inheritdoc} |
||
84 | */ |
||
85 | 12 | protected function removeAssociation($parent, string $subresource, $subId = null) |
|
89 | |||
90 | protected function getServiceId() |
||
94 | |||
95 | /** |
||
96 | * @return CrudServiceInterface |
||
97 | */ |
||
98 | abstract protected function getService(); |
||
99 | } |
||
100 |