1 | <?php |
||
16 | abstract class AbstractCrudServiceRestResourceController extends AbstractRestResourceController |
||
17 | { |
||
18 | 82 | public function __construct( |
|
33 | |||
34 | /** |
||
35 | * {@inheritdoc} |
||
36 | */ |
||
37 | 6 | protected function listEntities(int $page = 1, int $perPage = 50) |
|
41 | |||
42 | /** |
||
43 | * {@inheritdoc} |
||
44 | */ |
||
45 | 58 | protected function fetchEntity($id) |
|
54 | |||
55 | /** |
||
56 | * {@inheritdoc} |
||
57 | */ |
||
58 | 10 | protected function createEntity($entity) |
|
62 | |||
63 | /** |
||
64 | * {@inheritdoc} |
||
65 | */ |
||
66 | 10 | protected function updateEntity($entity) |
|
70 | |||
71 | /** |
||
72 | * {@inheritdoc} |
||
73 | */ |
||
74 | 2 | protected function removeEntity($entity) |
|
78 | |||
79 | /** |
||
80 | * {@inheritdoc} |
||
81 | */ |
||
82 | 6 | protected function listSubresource($entity, string $subresource, int $page = 1, int $perPage = 50) |
|
86 | |||
87 | /** |
||
88 | * {@inheritdoc} |
||
89 | */ |
||
90 | 4 | protected function buildAssociation($parent, string $subresource, $entity) |
|
94 | |||
95 | /** |
||
96 | * {@inheritdoc} |
||
97 | */ |
||
98 | 4 | protected function createAssociation($associatedEntity) |
|
102 | |||
103 | /** |
||
104 | * {@inheritdoc} |
||
105 | */ |
||
106 | 12 | protected function addAssociation($parent, string $subresource, $subId) |
|
110 | |||
111 | /** |
||
112 | * {@inheritdoc} |
||
113 | */ |
||
114 | 12 | protected function removeAssociation($parent, string $subresource, $subId = null) |
|
118 | |||
119 | protected function getServiceId() |
||
123 | |||
124 | /** |
||
125 | * @return CrudServiceInterface |
||
126 | */ |
||
127 | abstract protected function getService(); |
||
128 | } |
||
129 |