1 | <?php |
||
33 | class StepMiddlewareService implements SingletonInterface |
||
34 | { |
||
35 | use SelfInstantiateTrait; |
||
36 | |||
37 | /** |
||
38 | * @var FormObject |
||
39 | */ |
||
40 | protected $formObject; |
||
41 | |||
42 | /** |
||
43 | * @var StepMiddlewareValidationService |
||
44 | */ |
||
45 | protected $validationService; |
||
46 | |||
47 | /** |
||
48 | * @var FormStepPersistence |
||
49 | */ |
||
50 | protected $persistence; |
||
51 | |||
52 | /** |
||
53 | * @param FormObject $formObject |
||
54 | */ |
||
55 | public function reset(FormObject $formObject) |
||
64 | |||
65 | /** |
||
66 | * @see \Romm\Formz\Middleware\Item\Step\Service\StepMiddlewareValidationService::markStepAsValidated |
||
67 | * |
||
68 | * @param StepDefinition $stepDefinition |
||
69 | * @param array $formValues |
||
70 | */ |
||
71 | public function markStepAsValidated(StepDefinition $stepDefinition, array $formValues) |
||
75 | |||
76 | /** |
||
77 | * @see \Romm\Formz\Middleware\Item\Step\Service\StepMiddlewareValidationService::addValidatedFields |
||
78 | * |
||
79 | * @param array $validatedFields |
||
80 | */ |
||
81 | public function addValidatedFields(array $validatedFields) |
||
85 | |||
86 | /** |
||
87 | * @see \Romm\Formz\Middleware\Item\Step\Service\StepMiddlewareValidationService::stepDefinitionIsValid |
||
88 | * |
||
89 | * @param StepDefinition $stepDefinition |
||
90 | * @return bool |
||
91 | */ |
||
92 | public function stepIsValid(StepDefinition $stepDefinition) |
||
96 | |||
97 | /** |
||
98 | * @see \Romm\Formz\Middleware\Item\Step\Service\StepMiddlewareValidationService::getFirstInvalidStep |
||
99 | * |
||
100 | * @param Step $step |
||
101 | * @return StepDefinition|null |
||
102 | */ |
||
103 | public function getFirstInvalidStep(Step $step) |
||
107 | |||
108 | /** |
||
109 | * @param StepDefinition $step |
||
110 | * @return StepDefinition |
||
111 | */ |
||
112 | public function getNextStepDefinition(StepDefinition $step) |
||
139 | |||
140 | /** |
||
141 | * @param StepDefinition $stepDefinition |
||
142 | * @param Redirect $redirect |
||
143 | */ |
||
144 | public function moveForwardToStep(StepDefinition $stepDefinition, Redirect $redirect) |
||
149 | |||
150 | /** |
||
151 | * Redirects the current request to the given step. |
||
152 | * |
||
153 | * @param Step $step |
||
154 | * @param Redirect $redirect |
||
155 | */ |
||
156 | public function redirectToStep(Step $step, Redirect $redirect) |
||
169 | |||
170 | /** |
||
171 | * @param Step $step |
||
172 | * @return StepDefinition|null |
||
173 | */ |
||
174 | public function getStepDefinition(Step $step) |
||
178 | |||
179 | /** |
||
180 | * @param Step $step |
||
181 | * @param StepDefinition $stepDefinition |
||
182 | * @return StepDefinition|null |
||
183 | */ |
||
184 | protected function findStep(Step $step, StepDefinition $stepDefinition) |
||
220 | |||
221 | /** |
||
222 | * @return FormStepPersistence |
||
223 | */ |
||
224 | public function getStepPersistence() |
||
228 | |||
229 | /** |
||
230 | * @return FormObject |
||
231 | */ |
||
232 | public function getFormObject() |
||
236 | |||
237 | /** |
||
238 | * @return StepDefinition |
||
239 | */ |
||
240 | public function getFirstStepDefinition() |
||
244 | } |
||
245 |