FormPersistenceManager implements FormPersistenceManagerInterface
Form Persistence Manager - Entry point for FormManagerController
This manager acts as a facade that delegates storage operations to appropriate storage adapters via the StorageAdapterFactory.
Scope: frontend / backend
Attributes
- #[AsAlias]
- \TYPO3\CMS\Form\Mvc\Persistence\FormPersistenceManagerInterface::class
Table of Contents
Interfaces
- FormPersistenceManagerInterface
- The form persistence manager interface
Methods
- __construct() : mixed
- delete() : void
- Delete form definition from storage
- getAccessibleStorageAdapters() : array<string|int, mixed>
- getUniqueIdentifier() : string
- Get unique identifier (not persistence identifier)
- getUniquePersistenceIdentifier() : string
- Get unique persistence identifier for a new form
- hasForms() : bool
- Check if any forms are available
- hasValidFileExtension() : bool
- Check if file has valid extension
- isAllowedPersistenceIdentifier() : bool
- Check if a persistence identifier is allowed
- isAllowedStorageLocation() : bool
- Check if a storage location is allowed
- listForms() : array<string|int, mixed>
- List all form definitions from all available storages
- load() : array<string|int, mixed>
- Load form definition and apply event listeners and TypoScript overrides
- save() : FormIdentifier
- Save form definition to appropriate storage
- sortForms() : array<string|int, mixed>
Methods
__construct()
public
__construct(StorageAdapterFactory $storageAdapterFactory, FrontendInterface $runtimeCache, EventDispatcherInterface $eventDispatcher, TypoScriptService $typoScriptService, DatabaseService $databaseService) : mixed
Parameters
- $storageAdapterFactory : StorageAdapterFactory
- $runtimeCache : FrontendInterface
- $eventDispatcher : EventDispatcherInterface
- $typoScriptService : TypoScriptService
- $databaseService : DatabaseService
delete()
Delete form definition from storage
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()
Get unique identifier (not persistence identifier)
public
getUniqueIdentifier(string $identifier) : string
Parameters
- $identifier : string
Return values
stringgetUniquePersistenceIdentifier()
Get unique persistence identifier for a new form
public
getUniquePersistenceIdentifier(string $storage, string $formIdentifier, string|null $savePath) : string
Parameters
- $storage : string
- $formIdentifier : string
- $savePath : string|null
Return values
stringhasForms()
Check if any forms are available
public
hasForms(array<string|int, mixed> $formSettings) : bool
Parameters
- $formSettings : array<string|int, mixed>
Return values
boolhasValidFileExtension()
Check if file has valid extension
public
hasValidFileExtension(string $fileName) : bool
Parameters
- $fileName : string
Return values
boolisAllowedPersistenceIdentifier()
Check if a persistence identifier is allowed
public
isAllowedPersistenceIdentifier(string $persistenceIdentifier) : bool
For database storage: identifier is a UID or NEW* For file storage: identifier is a full file path (e.g., "1:/forms/contact.form.yaml")
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 is allowed
public
isAllowedStorageLocation(string $storageLocation) : bool
For database storage: storageLocation is a PID For file storage: storageLocation is a folder path (e.g., "1:/forms/")
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 from all available storages
public
listForms(array<string|int, mixed> $formSettings, SearchCriteria $searchCriteria) : array<string|int, mixed>
Parameters
- $formSettings : array<string|int, mixed>
- $searchCriteria : SearchCriteria
Return values
array<string|int, mixed> —in the format [['name' => 'Form 01', 'persistenceIdentifier' => 'path1'], [ .... ]]
load()
Load form definition and apply event listeners and TypoScript overrides
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 form definition to appropriate storage
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
Tags
Return values
FormIdentifiersortForms()
protected
sortForms(array<string|int, mixed> $forms, array<string|int, mixed> $formSettings[, string $orderField = '' ][, string|null $orderDirection = null ]) : array<string|int, mixed>
Parameters
- $forms : array<string|int, mixed>
- $formSettings : array<string|int, mixed>
- $orderField : string = ''
- $orderDirection : string|null = null