21 lines
651 B
PHP
21 lines
651 B
PHP
<?php
|
|
|
|
interface RsvFormElementHandler {
|
|
function draw(RsvFormElementDefinition $def) : void;
|
|
|
|
/**
|
|
* Validate and execute the element. Records errors on $result and returns
|
|
* false if it cannot complete.
|
|
*
|
|
* @param array<int,mixed> $data
|
|
*/
|
|
function submit(RsvFormElementDefinition $def, int $submit_id, array $data, RsvFormSubmitResult $result) : bool;
|
|
|
|
/**
|
|
* Undo a successful submit(); a no-op for elements without side effects.
|
|
*
|
|
* @param array<int,mixed> $data
|
|
*/
|
|
function rollback(RsvFormElementDefinition $def, int $submit_id, array $data, RsvFormSubmitResult $result) : void;
|
|
}
|