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) |
||
63 | |||
64 | /** |
||
65 | * @see \Romm\Formz\Middleware\Item\Step\Service\StepMiddlewareValidationService::markStepAsValidated |
||
66 | * |
||
67 | * @param StepDefinition $stepDefinition |
||
68 | * @param array $formValues |
||
69 | */ |
||
70 | public function markStepAsValidated(StepDefinition $stepDefinition, array $formValues) |
||
74 | |||
75 | /** |
||
76 | * @see \Romm\Formz\Middleware\Item\Step\Service\StepMiddlewareValidationService::addValidatedFields |
||
77 | * |
||
78 | * @param array $validatedFields |
||
79 | */ |
||
80 | public function addValidatedFields(array $validatedFields) |
||
84 | |||
85 | /** |
||
86 | * @see \Romm\Formz\Middleware\Item\Step\Service\StepMiddlewareValidationService::stepDefinitionIsValid |
||
87 | * |
||
88 | * @param StepDefinition $stepDefinition |
||
89 | * @return bool |
||
90 | */ |
||
91 | public function stepIsValid(StepDefinition $stepDefinition) |
||
95 | |||
96 | /** |
||
97 | * @see \Romm\Formz\Middleware\Item\Step\Service\StepMiddlewareValidationService::getFirstInvalidStep |
||
98 | * |
||
99 | * @param Step $step |
||
100 | * @return StepDefinition|null |
||
101 | */ |
||
102 | public function getFirstInvalidStep(Step $step) |
||
106 | |||
107 | /** |
||
108 | * @param StepDefinition $step |
||
109 | * @param bool $removeConditionalSteps |
||
110 | * @return StepDefinition |
||
111 | */ |
||
112 | public function getNextStepDefinition(StepDefinition $step, $removeConditionalSteps = false) |
||
147 | |||
148 | /** |
||
149 | * @param StepDefinition $stepDefinition |
||
150 | * @param Redirect $redirect |
||
151 | */ |
||
152 | public function moveForwardToStep(StepDefinition $stepDefinition, Redirect $redirect) |
||
157 | |||
158 | /** |
||
159 | * Redirects the current request to the given step. |
||
160 | * |
||
161 | * @param Step $step |
||
162 | * @param Redirect $redirect |
||
163 | */ |
||
164 | public function redirectToStep(Step $step, Redirect $redirect) |
||
177 | |||
178 | /** |
||
179 | * @param StepDefinition $stepDefinition |
||
180 | * @return bool |
||
181 | */ |
||
182 | public function getStepDefinitionConditionResult(StepDefinition $stepDefinition) |
||
191 | |||
192 | /** |
||
193 | * @param Step $step |
||
194 | * @return StepDefinition|null |
||
195 | */ |
||
196 | public function getStepDefinition(Step $step) |
||
200 | |||
201 | /** |
||
202 | * @param Step $step |
||
203 | * @param StepDefinition $stepDefinition |
||
204 | * @return StepDefinition|null |
||
205 | */ |
||
206 | protected function findStepDefinition(Step $step, StepDefinition $stepDefinition) |
||
232 | |||
233 | /** |
||
234 | * @return FormStepPersistence |
||
235 | */ |
||
236 | public function getStepPersistence() |
||
240 | |||
241 | /** |
||
242 | * @return FormObject |
||
243 | */ |
||
244 | public function getFormObject() |
||
248 | |||
249 | /** |
||
250 | * @return StepDefinition |
||
251 | */ |
||
252 | public function getFirstStepDefinition() |
||
256 | } |
||
257 |