1 | <?php |
||
20 | final class NewViewModel implements TemplateViewModelInterface |
||
21 | { |
||
22 | /** |
||
23 | * @var FormInterface |
||
24 | */ |
||
25 | private $form; |
||
26 | |||
27 | /** |
||
28 | * The view model constructor depends on the most raw elements possible. |
||
29 | */ |
||
30 | public function __construct(FormInterface $form) |
||
34 | |||
35 | /** |
||
36 | * We create named constructors for the cases where we need to extract the raw data from complex data structures. |
||
37 | */ |
||
38 | public static function fromPostAndForm(FormInterface $form): self |
||
42 | |||
43 | public function getForm(): FormInterface |
||
47 | } |
||
48 |