1 | <?php |
||
17 | abstract class AbstractCrudServiceRestResourceController extends AbstractRestResourceController |
||
18 | { |
||
19 | 80 | public function __construct( |
|
36 | |||
37 | /** |
||
38 | * {@inheritdoc} |
||
39 | */ |
||
40 | 6 | protected function listEntities(int $page = 1, int $perPage = 50) |
|
44 | |||
45 | /** |
||
46 | * {@inheritdoc} |
||
47 | */ |
||
48 | 56 | protected function fetchEntity($id) |
|
57 | |||
58 | /** |
||
59 | * {@inheritdoc} |
||
60 | */ |
||
61 | 10 | protected function createEntity($entity) |
|
65 | |||
66 | /** |
||
67 | * {@inheritdoc} |
||
68 | */ |
||
69 | 10 | protected function updateEntity($entity) |
|
73 | |||
74 | /** |
||
75 | * {@inheritdoc} |
||
76 | */ |
||
77 | 2 | protected function removeEntity($entity) |
|
81 | |||
82 | /** |
||
83 | * {@inheritdoc} |
||
84 | */ |
||
85 | 6 | protected function listSubresource($entity, string $subresource, int $page = 1, int $perPage = 50) |
|
89 | |||
90 | /** |
||
91 | * {@inheritdoc} |
||
92 | */ |
||
93 | 2 | protected function createAssociation($parent, string $subresource, $entity) |
|
97 | |||
98 | /** |
||
99 | * {@inheritdoc} |
||
100 | */ |
||
101 | 12 | protected function addAssociation($parent, string $subresource, $subId) |
|
105 | |||
106 | /** |
||
107 | * {@inheritdoc} |
||
108 | */ |
||
109 | 12 | protected function removeAssociation($parent, string $subresource, $subId = null) |
|
113 | |||
114 | protected function getServiceId() |
||
118 | |||
119 | /** |
||
120 | * @return CrudServiceInterface |
||
121 | */ |
||
122 | abstract protected function getService(); |
||
123 | } |
||
124 |