1 | <?php |
||
17 | trait ControllerBasicFeaturesTrait |
||
18 | { |
||
19 | /** |
||
20 | * Gets a container service by its id. |
||
21 | * |
||
22 | * @param string $id The service id |
||
23 | * |
||
24 | * @return object The service |
||
25 | */ |
||
26 | abstract protected function get($id); |
||
27 | |||
28 | /** |
||
29 | * Creates and returns a Form instance from the type of the form. |
||
30 | * |
||
31 | * @param string $type The fully qualified class name of the form type |
||
32 | * @param mixed $data The initial data for the form |
||
33 | * @param array $options Options for the form |
||
34 | * |
||
35 | * @return Form |
||
36 | */ |
||
37 | abstract protected function createForm($type, $data = null, array $options = array()); |
||
38 | |||
39 | /** |
||
40 | * @param Request $request |
||
41 | * @param string $repositoryName |
||
42 | * |
||
43 | * @return array |
||
44 | */ |
||
45 | 1 | protected function getCollectionPaginated(Request $request, $repositoryName) |
|
68 | |||
69 | /** |
||
70 | * @param Request $request |
||
71 | * @param string $repositoryName |
||
72 | * |
||
73 | * @return mixed|\FOS\RestBundle\View\View |
||
74 | */ |
||
75 | 2 | protected function getAnElement(Request $request, $repositoryName) |
|
87 | |||
88 | /** |
||
89 | * @param Request $request |
||
90 | * @param mixed $element |
||
91 | * @param string $formClassName |
||
92 | * |
||
93 | * @return mixed |
||
94 | */ |
||
95 | 2 | protected function createAnElement(Request $request, $element, $formClassName) |
|
103 | |||
104 | /** |
||
105 | * @param Request $request |
||
106 | * @param string $repositoryName |
||
107 | */ |
||
108 | 2 | protected function removeAnElement(Request $request, $repositoryName) |
|
119 | |||
120 | /** |
||
121 | * @param Request $request |
||
122 | * @param bool $clearMissing |
||
123 | * |
||
124 | * @return mixed|Form|\FOS\RestBundle\View\View |
||
125 | */ |
||
126 | 6 | protected function updateAnElement(Request $request, $clearMissing, $repositoryName, $formClassName) |
|
142 | |||
143 | /** |
||
144 | * @param Form $form |
||
145 | * @param mixed $element |
||
146 | * |
||
147 | * @return mixed|Form |
||
148 | */ |
||
149 | 6 | private function checkFormAndPersist(Form $form, $element) |
|
161 | } |
||
162 |