FormDefinitionDataHandlerHook
Denies direct DataHandler write access to the form_definition table unless FormDefinitionPersistenceGuard has granted a matching invocation. This ensures form definitions can only be persisted through DatabaseStorageAdapter, which applies the form persistence manager's validation and permission checks.
Registered as processDatamapClass (create/update) and processCmdmapClass (delete) so each path carries command, identifier, and field-level checks.
Attributes
- #[Autoconfigure]
- $public: true
Table of Contents
Methods
- __construct() : mixed
- processCmdmap() : void
- Blocks unauthorised delete commands on form_definition records.
- processDatamap_preProcessFieldArray() : void
- Verifies create/update operations against the pending invocation grant.
Methods
__construct()
public
__construct(FormDefinitionPersistenceGuard $guard) : mixed
Parameters
- $guard : FormDefinitionPersistenceGuard
processCmdmap()
Blocks unauthorised delete commands on form_definition records.
public
processCmdmap(string $command, string $table, int|string $id, mixed $value, bool &$commandIsProcessed, DataHandler $dataHandler) : void
Sets $commandIsProcessed to true (preventing DataHandler's built-in delete) when no COMMAND_FORM_DELETE grant is pending. This mirrors the FilePersistenceSlot pattern for FAL-based form definitions.
Parameters
- $command : string
- $table : string
- $id : int|string
- $value : mixed
- $commandIsProcessed : bool
- $dataHandler : DataHandler
processDatamap_preProcessFieldArray()
Verifies create/update operations against the pending invocation grant.
public
processDatamap_preProcessFieldArray(array<string, mixed>|null &$incomingFieldArray, string $table, string|int $id, DataHandler $dataHandler) : void
The command is derived from $id: a NEW-prefixed string means create, an integer means update. The full incoming field array is matched against the stored field names and HMAC. Setting $incomingFieldArray to null cancels the record in DataHandler.
Parameters
- $incomingFieldArray : array<string, mixed>|null
- $table : string
- $id : string|int
- $dataHandler : DataHandler