1 | <?php |
||
8 | abstract class CrudServiceRestResourceController extends AbstractRestResourceController |
||
9 | { |
||
10 | /** |
||
11 | * {@inheritdoc} |
||
12 | */ |
||
13 | 6 | protected function listEntities(int $page = 1, int $perPage = 50) |
|
17 | |||
18 | /** |
||
19 | * {@inheritdoc} |
||
20 | */ |
||
21 | 56 | protected function fetchEntity($id) |
|
30 | |||
31 | /** |
||
32 | * {@inheritdoc} |
||
33 | */ |
||
34 | 10 | protected function createEntity($entity) |
|
38 | |||
39 | /** |
||
40 | * {@inheritdoc} |
||
41 | */ |
||
42 | 10 | protected function updateEntity($entity) |
|
46 | |||
47 | /** |
||
48 | * {@inheritdoc} |
||
49 | */ |
||
50 | 2 | protected function removeEntity($entity) |
|
54 | |||
55 | /** |
||
56 | * {@inheritdoc} |
||
57 | */ |
||
58 | 6 | protected function listSubresource($entity, string $property, int $page = 1, int $perPage = 50) |
|
62 | |||
63 | /** |
||
64 | * {@inheritdoc} |
||
65 | */ |
||
66 | 2 | protected function createAssociation($parent, string $subresource) |
|
70 | |||
71 | /** |
||
72 | * {@inheritdoc} |
||
73 | */ |
||
74 | 2 | protected function createSubResource($parent, $subresource, $entity) |
|
78 | |||
79 | /** |
||
80 | * {@inheritdoc} |
||
81 | */ |
||
82 | 12 | protected function addAssociation($parent, string $subresource, $subId) |
|
86 | |||
87 | /** |
||
88 | * {@inheritdoc} |
||
89 | */ |
||
90 | 12 | protected function removeAssociation($parent, string $subresource, $subId = null) |
|
94 | |||
95 | 72 | protected function getServiceId() |
|
99 | |||
100 | /** |
||
101 | * @return CrudServiceInterface |
||
102 | */ |
||
103 | abstract protected function getService(); |
||
104 | } |
||
105 |