1 | <?php |
||
17 | abstract class AbstractCrudServiceRestResourceController extends AbstractRestResourceController |
||
18 | { |
||
19 | 80 | public function __construct( |
|
34 | |||
35 | /** |
||
36 | * {@inheritdoc} |
||
37 | */ |
||
38 | 6 | protected function listEntities(int $page = 1, int $perPage = 50) |
|
42 | |||
43 | /** |
||
44 | * {@inheritdoc} |
||
45 | */ |
||
46 | 56 | protected function fetchEntity($id) |
|
55 | |||
56 | /** |
||
57 | * {@inheritdoc} |
||
58 | */ |
||
59 | 10 | protected function createEntity($entity) |
|
63 | |||
64 | /** |
||
65 | * {@inheritdoc} |
||
66 | */ |
||
67 | 10 | protected function updateEntity($entity) |
|
71 | |||
72 | /** |
||
73 | * {@inheritdoc} |
||
74 | */ |
||
75 | 2 | protected function removeEntity($entity) |
|
79 | |||
80 | /** |
||
81 | * {@inheritdoc} |
||
82 | */ |
||
83 | 6 | protected function listSubresource($entity, string $subresource, int $page = 1, int $perPage = 50) |
|
87 | |||
88 | /** |
||
89 | * {@inheritdoc} |
||
90 | */ |
||
91 | 2 | protected function buildAssociation($parent, string $subresource, $entity) |
|
95 | |||
96 | /** |
||
97 | * {@inheritdoc} |
||
98 | */ |
||
99 | 2 | protected function createAssociation($associatedEntity) |
|
103 | |||
104 | /** |
||
105 | * {@inheritdoc} |
||
106 | */ |
||
107 | 12 | protected function addAssociation($parent, string $subresource, $subId) |
|
111 | |||
112 | /** |
||
113 | * {@inheritdoc} |
||
114 | */ |
||
115 | 12 | protected function removeAssociation($parent, string $subresource, $subId = null) |
|
119 | |||
120 | protected function getServiceId() |
||
124 | |||
125 | /** |
||
126 | * @return CrudServiceInterface |
||
127 | */ |
||
128 | abstract protected function getService(); |
||
129 | } |
||
130 |