AbstractFileStorageAdapter
Abstract helper class for file-based form persistence
Provides shared utility methods for file-based storage adapters. Concrete storage adapters must implement StorageAdapterInterface.
Table of Contents
Constants
- FORM_DEFINITION_FILE_EXTENSION = \TYPO3\CMS\Form\Mvc\Persistence\FormPersistenceManagerInterface::FORM_DEFINITION_FILE_EXTENSION
Properties
Methods
- exists() : bool
- existsByFormIdentifier() : bool
- findAll() : array<string|int, mixed>
- getUniquePersistenceIdentifier() : string
- This takes a form identifier and returns a unique persistence identifier for it.
- injectStorageRepository() : void
- buildStorageLocationLabel() : string
- Build a user-friendly storageLocation label for display Each storage adapter implements this to provide appropriate storageLocation information
- extractMetaDataFromCouldBeFormDefinition() : array<string|int, mixed>
- generateErrorsIfFormDefinitionIsValidButHasInvalidFileExtension() : void
- hasValidFileExtension() : bool
- looksLikeAFormDefinition() : bool
- looksLikeAFormDefinitionArray() : bool
- Check if array looks like a form definition
- matchesCriteria() : bool
- Check if form data matches search criteria
Constants
FORM_DEFINITION_FILE_EXTENSION
public
mixed
FORM_DEFINITION_FILE_EXTENSION
= \TYPO3\CMS\Form\Mvc\Persistence\FormPersistenceManagerInterface::FORM_DEFINITION_FILE_EXTENSION
Properties
$storageRepository
protected
StorageRepository|null
$storageRepository
= null
Methods
exists()
public
abstract exists(FormIdentifier $identifier) : bool
Parameters
- $identifier : FormIdentifier
Return values
boolexistsByFormIdentifier()
public
abstract existsByFormIdentifier(string $formIdentifier) : bool
Parameters
- $formIdentifier : string
Return values
boolfindAll()
public
abstract findAll(SearchCriteria $criteria) : array<string|int, mixed>
Parameters
- $criteria : SearchCriteria
Return values
array<string|int, mixed>getUniquePersistenceIdentifier()
This takes a form identifier and returns a unique persistence identifier for it.
public
getUniquePersistenceIdentifier(string $formIdentifier, string $storageLocation) : string
By default, this is just similar to the identifier. But if a form with the same persistence identifier already exists a suffix is appended until the persistence identifier is unique.
Parameters
- $formIdentifier : string
-
lowerCamelCased form identifier
- $storageLocation : string
-
Path where the form should be saved (e.g., "1:/forms/")
Tags
Return values
string —unique form persistence identifier (e.g., "1:/forms/contact.form.yaml")
injectStorageRepository()
public
injectStorageRepository(StorageRepository $storageRepository) : void
Parameters
- $storageRepository : StorageRepository
buildStorageLocationLabel()
Build a user-friendly storageLocation label for display Each storage adapter implements this to provide appropriate storageLocation information
protected
abstract buildStorageLocationLabel(string $persistenceIdentifier) : string
Parameters
- $persistenceIdentifier : string
Return values
stringextractMetaDataFromCouldBeFormDefinition()
protected
extractMetaDataFromCouldBeFormDefinition(string $maybeRawFormDefinition) : array<string|int, mixed>
Parameters
- $maybeRawFormDefinition : string
Return values
array<string|int, mixed>generateErrorsIfFormDefinitionIsValidButHasInvalidFileExtension()
protected
generateErrorsIfFormDefinitionIsValidButHasInvalidFileExtension(array<string|int, mixed> $formDefinition, string $identifier) : void
Parameters
- $formDefinition : array<string|int, mixed>
- $identifier : string
Tags
hasValidFileExtension()
protected
hasValidFileExtension(string $identifier) : bool
Parameters
- $identifier : string
Return values
boollooksLikeAFormDefinition()
protected
looksLikeAFormDefinition(FormMetadata $formMetadata) : bool
Parameters
- $formMetadata : FormMetadata
Return values
boollooksLikeAFormDefinitionArray()
Check if array looks like a form definition
protected
looksLikeAFormDefinitionArray(array<string|int, mixed> $data) : bool
Parameters
- $data : array<string|int, mixed>
Return values
boolmatchesCriteria()
Check if form data matches search criteria
protected
matchesCriteria(FormMetadata $formMetadata, SearchCriteria $criteria) : bool
Parameters
- $formMetadata : FormMetadata
- $criteria : SearchCriteria