1 | <?php |
||
23 | class FormObjectSteps |
||
24 | { |
||
25 | const METADATA_STEP_PERSISTENCE_KEY = 'core.formStepPersistence'; |
||
26 | |||
27 | /** |
||
28 | * @var FormObject |
||
29 | */ |
||
30 | protected $formObject; |
||
31 | |||
32 | /** |
||
33 | * Step persistence is saved in the form metadata. |
||
34 | * |
||
35 | * It allows having essential information about the form steps whenever it |
||
36 | * is needed: submitted form values, as well as steps that were already |
||
37 | * validated. |
||
38 | * |
||
39 | * @var FormStepPersistence |
||
40 | */ |
||
41 | protected $stepPersistence; |
||
42 | |||
43 | /** |
||
44 | * @param FormObject $formObject |
||
45 | */ |
||
46 | public function __construct(FormObject $formObject) |
||
50 | |||
51 | /** |
||
52 | * This function will search among the registered steps to find the one that |
||
53 | * has the same controller parameters. |
||
54 | * |
||
55 | * It is also possible not to find any step, in this case `null` is |
||
56 | * returned. |
||
57 | * |
||
58 | * @param Request $request |
||
59 | * @return Step|null |
||
60 | */ |
||
61 | public function getCurrentStep(Request $request) |
||
96 | |||
97 | /** |
||
98 | * Fetches the step persistence object for the form, which may have been |
||
99 | * stored in the form metadata. |
||
100 | * |
||
101 | * If the form object hash did change since the persistence object was saved |
||
102 | * it is "refreshed" with the new hash (some data are also deleted as they |
||
103 | * are no longer considered as valid). |
||
104 | * |
||
105 | * @return FormStepPersistence |
||
106 | */ |
||
107 | public function getStepPersistence() |
||
132 | } |
||
133 |