1 | <?php |
||
14 | class CreateForm extends FormModel |
||
15 | { |
||
16 | /** |
||
17 | * Constructor injects with DI container. |
||
18 | * |
||
19 | * @param ContainerInterface $di a service container |
||
20 | * @param string $questionId the id of the question |
||
21 | */ |
||
22 | public function __construct(ContainerInterface $di, string $questionId) |
||
50 | |||
51 | |||
52 | |||
53 | /** |
||
54 | * Callback for submit-button which should return true if it could |
||
55 | * carry out its work and false if something failed. |
||
56 | * |
||
57 | * @return bool true if okey, false if something went wrong. |
||
58 | */ |
||
59 | public function callbackSubmit() : bool |
||
71 | |||
72 | |||
73 | |||
74 | /** |
||
75 | * Callback what to do if the form was successfully submitted, this |
||
76 | * happen when the submit callback method returns true. This method |
||
77 | * can/should be implemented by the subclass for a different behaviour. |
||
78 | */ |
||
79 | public function callbackSuccess() |
||
83 | |||
84 | |||
85 | |||
86 | /** |
||
87 | * Callback what to do if the form was unsuccessfully submitted, this |
||
88 | * happen when the submit callback method returns false or if validation |
||
89 | * fails. This method can/should be implemented by the subclass for a |
||
90 | * different behaviour. |
||
91 | */ |
||
92 | public function callbackFail() |
||
97 | } |
||
98 |