| 1 | <?php |
||
| 10 | class HandleFormContext |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var bool |
||
| 14 | */ |
||
| 15 | private $success; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var string[] |
||
| 19 | */ |
||
| 20 | private $errors; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * HandleFormContext constructor. |
||
| 24 | * |
||
| 25 | * @param bool $success |
||
| 26 | * @param array $errors |
||
| 27 | */ |
||
| 28 | public function __construct($success, array $errors) |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Was the handling of the form successful? |
||
| 36 | * |
||
| 37 | * @return bool |
||
| 38 | */ |
||
| 39 | public function isSuccess() |
||
| 43 | |||
| 44 | /** |
||
| 45 | * List of translated error message to display in the frontend. |
||
| 46 | * |
||
| 47 | * @return string[] |
||
| 48 | */ |
||
| 49 | public function getErrors() |
||
| 53 | } |
||
| 54 |