1 | <?php |
||
15 | trait ControllerWorkflowFeaturesTrait |
||
16 | { |
||
17 | /** |
||
18 | * Gets a container service by its id. |
||
19 | * |
||
20 | * @param string $id The service id |
||
21 | * |
||
22 | * @return object The service |
||
23 | */ |
||
24 | abstract protected function get($id); |
||
25 | |||
26 | /** |
||
27 | * Creates and returns a Form instance from the type of the form. |
||
28 | * |
||
29 | * @param string $type The fully qualified class name of the form type |
||
30 | * @param mixed $data The initial data for the form |
||
31 | * @param array $options Options for the form |
||
32 | * |
||
33 | * @return Form |
||
34 | */ |
||
35 | abstract protected function createForm($type, $data = null, array $options = []); |
||
36 | |||
37 | /** |
||
38 | * @param Request $request |
||
39 | * @param string $repositoryName |
||
40 | * @param string $workflowName |
||
41 | * |
||
42 | * @return mixed |
||
43 | */ |
||
44 | protected function workflowStatutAvailable(Request $request, $repositoryName, $workflowName) |
||
58 | |||
59 | /** |
||
60 | * @param Request $request |
||
61 | * @param string $repositoryName |
||
62 | * @param string $workflowName |
||
63 | * |
||
64 | * @return mixed |
||
65 | */ |
||
66 | protected function changeWorkflowStatut(Request $request, $repositoryName, $workflowName) |
||
87 | |||
88 | /** |
||
89 | * @param string $newState |
||
90 | * @param Workflow $workflow |
||
91 | * @param mixed $element |
||
92 | * |
||
93 | * @return bool|\FOS\RestBundle\View\View |
||
94 | */ |
||
95 | protected function checkIfElementCanChangeStatut(string $newState, Workflow $workflow, $element) |
||
107 | } |
||
108 |