ExtensionStorageAdapter extends AbstractFileStorageAdapter implements StorageAdapterInterface

Storage adapter for extension-based form persistence

Internal

Table of Contents

Interfaces

StorageAdapterInterface
Storage adapter interface for form persistence

Constants

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

Properties

$resourceFactory  : ResourceFactory
$runtimeCache  : FrontendInterface
$storageConfiguration  : PersistenceConfigurationService
$storageRepository  : StorageRepository|null
$yamlSource  : YamlSource

Methods

__construct()  : mixed
delete()  : void
Delete form definition from storage
exists()  : bool
existsByFormIdentifier()  : bool
findAll()  : array<string|int, mixed>
getAccessibleExtensionFolders()  : array<string|int, mixed>
Return a list of all accessible extension folders
getDescription()  : string
Get the description for this storage type
getFormManagerOptions()  : array<string|int, mixed>
Get options for the form manager interface
getIconIdentifier()  : string
Get the icon identifier for this storage type
getLabel()  : string
Get the human-readable label for this storage type
getPriority()  : int
Get priority for capability checking
getTypeIdentifier()  : string
Get unique identifier for this storage type
getUniquePersistenceIdentifier()  : string
This takes a form identifier and returns a unique persistence identifier for it.
injectStorageRepository()  : void
isAccessible()  : bool
Check if this storage is currently accessible
isAllowedPersistenceIdentifier()  : bool
Check if a persistence identifier (full file path) is allowed
isAllowedStorageLocation()  : bool
Check if a storage location (extension folder) is allowed
read()  : FormData
Read form definition from storage
supports()  : bool
Check if this adapter can handle the given persistence identifier
write()  : FormIdentifier
Write form definition to storage
buildStorageLocationLabel()  : string
Build a user-friendly storage location label Format: "extension_key/Configuration/Forms/file.form.yaml"
ensureValidPersistenceIdentifier()  : void
extractMetaDataFromCouldBeFormDefinition()  : array<string|int, mixed>
generateErrorsIfFormDefinitionIsValidButHasInvalidFileExtension()  : void
hasValidFileExtension()  : bool
isAccessibleExtensionFolder()  : bool
isFileWithinAccessibleExtensionFolders()  : bool
loadMetaData()  : FormMetadata
looksLikeAFormDefinition()  : bool
looksLikeAFormDefinitionArray()  : bool
Check if array looks like a form definition
matchesCriteria()  : bool
Check if form data matches search criteria
retrieveYamlFilesFromExtensionFolders()  : array<string|int, string>
Retrieves yaml files from extension folders for further processing.

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 existsByFormIdentifier(string $formIdentifier) : bool
Parameters
$formIdentifier : string
Return values
bool

getAccessibleExtensionFolders()

Return a list of all accessible extension folders

public getAccessibleExtensionFolders() : array<string|int, mixed>

Only registered mount points from persistenceManager.allowedExtensionPaths are listed.

Return values
array<string|int, mixed>

getDescription()

Get the description for this storage type

public getDescription() : string
Return values
string

translation key

getFormManagerOptions()

Get options for the form manager interface

public getFormManagerOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>

getIconIdentifier()

Get the icon identifier for this storage type

public getIconIdentifier() : string
Return values
string

icon identifier

getLabel()

Get the human-readable label for this storage type

public getLabel() : string
Return values
string

translation key

getPriority()

Get priority for capability checking

public getPriority() : int

Higher priority adapters are checked first. Allows extensions to override core adapters by providing higher priority.

Suggested ranges:

  • 0-49: Low priority / fallback adapters
  • 50-99: Normal priority (file mounts, database)
  • 100+: High priority (extension paths, specific handlers)
Return values
int

Priority (higher = checked first)

getTypeIdentifier()

Get unique identifier for this storage type

public getTypeIdentifier() : string

Used for metadata, display, and debugging purposes. Examples: 'extension', 'filemount', 'database'

Return values
string

Unique type identifier (lowercase, alphanumeric + underscore)

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")

isAccessible()

Check if this storage is currently accessible

public isAccessible() : bool
Return values
bool

isAllowedPersistenceIdentifier()

Check if a persistence identifier (full file path) is allowed

public isAllowedPersistenceIdentifier(string $persistenceIdentifier) : bool
Parameters
$persistenceIdentifier : string

The persistence identifier to check

Return values
bool

True if the persistence identifier is allowed

isAllowedStorageLocation()

Check if a storage location (extension folder) is allowed

public isAllowedStorageLocation(string $storageLocation) : bool
Parameters
$storageLocation : string

The storage location to check

Return values
bool

True if the storage location is allowed

supports()

Check if this adapter can handle the given persistence identifier

public supports(string $identifier) : bool
Parameters
$identifier : string

Persistence identifier (e.g., "EXT:my_extension/Forms/contact.form.yaml", "1:/forms/contact.form.yaml")

Return values
bool

True if this adapter can handle the identifier

buildStorageLocationLabel()

Build a user-friendly storage location label Format: "extension_key/Configuration/Forms/file.form.yaml"

protected 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

isAccessibleExtensionFolder()

protected isAccessibleExtensionFolder(string $folderName) : bool
Parameters
$folderName : string
Return values
bool

isFileWithinAccessibleExtensionFolders()

protected isFileWithinAccessibleExtensionFolders(string $fileName) : bool
Parameters
$fileName : 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

retrieveYamlFilesFromExtensionFolders()

Retrieves yaml files from extension folders for further processing.

protected retrieveYamlFilesFromExtensionFolders() : array<string|int, string>

At this time it's not determined yet, whether these files contain form data.

Return values
array<string|int, string>

        
On this page

Search results