22 lines
482 B
PHP
22 lines
482 B
PHP
<?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;
|
|
}
|
|
}
|