FormPersistenceManagerInterface
The form persistence manager interface
Scope: frontend / backend
Table of Contents
Constants
- FORM_DEFINITION_FILE_EXTENSION = '.form.yaml'
Methods
- delete() : void
- Delete the form representation identified by $persistenceIdentifier
- getAccessibleStorageAdapters() : array<string|int, mixed>
- getUniqueIdentifier() : string
- getUniquePersistenceIdentifier() : string
- This takes a form identifier and returns a unique persistence identifier for it.
- hasForms() : bool
- Check if any form definition is available
- hasValidFileExtension() : bool
- isAllowedPersistenceIdentifier() : bool
- Check if a persistence identifier (UID for database, full file path for files) is allowed
- isAllowedStorageLocation() : bool
- Check if a storage location (PID for database, folder path for files) is allowed
- listForms() : array<string|int, mixed>
- List all form definitions which can be loaded through this form persistence manager.
- load() : array<string|int, mixed>
- Load the array form representation identified by $persistenceIdentifier, and return it.
- save() : FormIdentifier
- Save the array form representation identified by $persistenceIdentifier
Constants
FORM_DEFINITION_FILE_EXTENSION
public
mixed
FORM_DEFINITION_FILE_EXTENSION
= '.form.yaml'
Methods
delete()
Delete the form representation identified by $persistenceIdentifier
public
delete(string $persistenceIdentifier, array<string|int, mixed> $formSettings) : void
Parameters
- $persistenceIdentifier : string
- $formSettings : array<string|int, mixed>
getAccessibleStorageAdapters()
public
getAccessibleStorageAdapters() : array<string|int, mixed>
Return values
array<string|int, mixed>getUniqueIdentifier()
public
getUniqueIdentifier(string $identifier) : string
Parameters
- $identifier : string
Return values
stringgetUniquePersistenceIdentifier()
This takes a form identifier and returns a unique persistence identifier for it.
public
getUniquePersistenceIdentifier(string $storage, string $formIdentifier, string|null $savePath) : string
Parameters
- $storage : string
- $formIdentifier : string
- $savePath : string|null
Return values
stringhasForms()
Check if any form definition is available
public
hasForms(array<string|int, mixed> $formSettings) : bool
Parameters
- $formSettings : array<string|int, mixed>
Return values
boolhasValidFileExtension()
public
hasValidFileExtension(string $fileName) : bool
Parameters
- $fileName : string
Return values
boolisAllowedPersistenceIdentifier()
Check if a persistence identifier (UID for database, full file path for files) is allowed
public
isAllowedPersistenceIdentifier(string $persistenceIdentifier) : bool
Parameters
- $persistenceIdentifier : string
-
The persistence identifier (e.g., "456" for UID, "1:/forms/contact.form.yaml" for file)
Return values
bool —True if the persistence identifier is allowed
isAllowedStorageLocation()
Check if a storage location (PID for database, folder path for files) is allowed
public
isAllowedStorageLocation(string $storageLocation) : bool
Parameters
- $storageLocation : string
-
The storage location (e.g., "123" for PID, "1:/forms/" for file path)
Return values
bool —True if the storageLocation is allowed
listForms()
List all form definitions which can be loaded through this form persistence manager.
public
listForms(array<string|int, mixed> $formSettings, SearchCriteria $searchCriteria) : array<string|int, mixed>
Returns an associative array with each item containing the keys 'name' (the human-readable name of the form) and 'persistenceIdentifier' (the unique identifier for the Form Persistence Manager e.g. the path to the saved form definition).
Parameters
- $formSettings : array<string|int, mixed>
- $searchCriteria : SearchCriteria
Return values
array<string|int, mixed> —in the format [['name' => 'Form 01', 'persistenceIdentifier' => 'path1'], [ .... ]]
load()
Load the array form representation identified by $persistenceIdentifier, and return it.
public
load(string $persistenceIdentifier[, array<string|int, mixed>|null $typoScriptSettings = null ][, ServerRequestInterface|null $request = null ]) : array<string|int, mixed>
Parameters
- $persistenceIdentifier : string
- $typoScriptSettings : array<string|int, mixed>|null = null
-
FE TS "plugin.tx_form.settings" - Given when rendering a form as plugin using FormFrontendController or formvh:render, empty array in all BE usages. Intended to override details like labels of single forms.
- $request : ServerRequestInterface|null = null
Return values
array<string|int, mixed>save()
Save the array form representation identified by $persistenceIdentifier
public
save(string $persistenceIdentifier, array<string|int, mixed> $formDefinition, array<string|int, mixed> $formSettings[, string|null $storageLocation = null ]) : FormIdentifier
Parameters
- $persistenceIdentifier : string
- $formDefinition : array<string|int, mixed>
- $formSettings : array<string|int, mixed>
- $storageLocation : string|null = null