initial
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
class RsvFormSubmitResult {
|
||||
private array $errors = [];
|
||||
private array $values = [];
|
||||
|
||||
public function addError(string $elementName, string $code, string $message): void {
|
||||
$this->errors[] = [
|
||||
'element' => $elementName,
|
||||
'code' => $code,
|
||||
'message' => $message
|
||||
];
|
||||
}
|
||||
|
||||
public function hasErrors(): bool {
|
||||
return count($this->errors) > 0;
|
||||
}
|
||||
|
||||
public function getErrors(): array {
|
||||
return $this->errors;
|
||||
}
|
||||
|
||||
public function setValue(string $name, $value): void {
|
||||
$this->values[$name] = $value;
|
||||
}
|
||||
|
||||
public function getValue(string $name) {
|
||||
return $this->values[$name] ?? null;
|
||||
}
|
||||
|
||||
public function getValues(): array {
|
||||
return $this->values;
|
||||
}
|
||||
|
||||
public function toDto(): array {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user