AbstractFileStorageAdapter

AbstractYes

Abstract helper class for file-based form persistence

Provides shared utility methods for file-based storage adapters. Concrete storage adapters must implement StorageAdapterInterface.

Internal

Table of Contents

Constants

FORM_DEFINITION_FILE_EXTENSION  = \TYPO3\CMS\Form\Mvc\Persistence\FormPersistenceManagerInterface::FORM_DEFINITION_FILE_EXTENSION

Properties

$storageRepository  : StorageRepository|null

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

Methods

existsByFormIdentifier()

public abstract existsByFormIdentifier(string $formIdentifier) : bool
Parameters
$formIdentifier : string
Return values
bool

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
throws
NoUniquePersistenceIdentifierException
throws
PersistenceManagerException
Return values
string

unique form persistence identifier (e.g., "1:/forms/contact.form.yaml")

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
string

extractMetaDataFromCouldBeFormDefinition()

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
throws
PersistenceManagerException

hasValidFileExtension()

protected hasValidFileExtension(string $identifier) : bool
Parameters
$identifier : string
Return values
bool

looksLikeAFormDefinitionArray()

Check if array looks like a form definition

protected looksLikeAFormDefinitionArray(array<string|int, mixed> $data) : bool
Parameters
$data : array<string|int, mixed>
Return values
bool

        
On this page

Search results