initial
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
class RsvFormData {
|
||||
private array $elements = [];
|
||||
|
||||
/**
|
||||
* @param array<int,mixed> $data
|
||||
*/
|
||||
public function __construct(array $data) {
|
||||
// Expecting raw post values as associative array
|
||||
$this->elements = $data['values'] ?? $data;
|
||||
}
|
||||
|
||||
public function getElements(): array {
|
||||
return $this->elements;
|
||||
}
|
||||
|
||||
public function getValue(string $name, $default = null) {
|
||||
return $this->elements[$name] ?? $default;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user