@@ -7,10 +7,12 @@ class RsvFormDefinition {
|
||||
|
||||
public string $email_key = "";
|
||||
|
||||
public array $membership = [];
|
||||
|
||||
public string $success_message = "";
|
||||
|
||||
/**
|
||||
* @param array<int,mixed> $definition Full definition array including 'elements', 'email_key' and 'success_message'.
|
||||
* @param array<string,mixed> $definition Full definition array including 'elements', 'email_key' and 'success_message'.
|
||||
*/
|
||||
public function __construct(string $id, array $definition) {
|
||||
$this->_elements = [];
|
||||
@@ -23,6 +25,7 @@ class RsvFormDefinition {
|
||||
|
||||
$this->_id = $id;
|
||||
$this->email_key = $definition['email_key'] ?? '';
|
||||
$this->membership = $definition['membership'] ?? [];
|
||||
$this->success_message = $definition['success_message'] ?? '';
|
||||
}
|
||||
|
||||
@@ -34,6 +37,15 @@ class RsvFormDefinition {
|
||||
return $this->email_key;
|
||||
}
|
||||
|
||||
/** @return array<int,array{program_id:int,discount:float,field:string}> */
|
||||
public function getMembershipBindings(): array {
|
||||
return $this->membership['bindings'] ?? [];
|
||||
}
|
||||
|
||||
public function getMembershipCombine(): string {
|
||||
return $this->membership['combine'] ?? 'max';
|
||||
}
|
||||
|
||||
/** Template shown to the visitor after a successful submission. */
|
||||
public function getSuccessMessage(): string {
|
||||
return $this->success_message;
|
||||
|
||||
Reference in New Issue
Block a user