FileMountStorageAdapter extends AbstractFileStorageAdapter implements StorageAdapterInterface
Storage adapter for filemount-based form persistence
Table of Contents
Interfaces
- StorageAdapterInterface
- Storage adapter interface for form persistence
Constants
- FORM_DEFINITION_FILE_EXTENSION = '.form.yaml'
Properties
- $filePersistenceSlot : FilePersistenceSlot
- $resourceFactory : ResourceFactory
- $runtimeCache : FrontendInterface
- $storageConfiguration : PersistenceConfigurationService
- $storageRepository : StorageRepository|null
- $yamlSource : YamlSource
Methods
- __construct() : mixed
- delete() : void
- Delete form definition from storage
- exists() : bool
- findAll() : array<string|int, mixed>
- getAccessibleFormStorageFolders() : array<string|int, Folder>
- Return a list of all accessible file mountpoints for the current backend user.
- getPriority() : int
- Get priority for capability checking
- getTypeIdentifier() : string
- Get unique identifier for this storage type
- getUniqueIdentifier() : string
- This takes a form identifier and returns a unique identifier for it.
- getUniquePersistenceIdentifier() : string
- This takes a form identifier and returns a unique persistence identifier for it.
- injectStorageRepository() : void
- isAllowedPersistencePath() : bool
- Check if a persistence path or if a persistence identifier path is configured within the form setup "persistenceManager.allowedExtensionPaths" or persistenceManager.allowedFileMounts".
- read() : FormData
- Read form definition from storage
- supports() : bool
- Check if this adapter can handle the given persistence identifier
- write() : void
- Write form definition to storage
- checkForDuplicateIdentifier() : bool
- Check if an identifier is already used by a formDefinition.
- ensureValidPersistenceIdentifier() : void
- extractMetaDataFromCouldBeFormDefinition() : array<string|int, mixed>
- generateErrorsIfFormDefinitionIsValidButHasInvalidFileExtension() : void
- getOrCreateFile() : File
- Returns a File object for a given $persistenceIdentifier.
- getStorageByUid() : ResourceStorage
- Returns a ResourceStorage for a given uid
- hasValidFileExtension() : bool
- isAccessibleFormStorageFolder() : bool
- isFileWithinAccessibleFormStorageFolders() : bool
- loadMetaData() : FormMetadata
- looksLikeAFormDefinition() : bool
- looksLikeAFormDefinitionArray() : bool
- Check if array looks like a form definition
- matchesCriteria() : bool
- Check if form data matches search criteria
- pathIsIntendedAsFileMountPath() : bool
- retrieveFileByPersistenceIdentifier() : File
Constants
FORM_DEFINITION_FILE_EXTENSION
public
mixed
FORM_DEFINITION_FILE_EXTENSION
= '.form.yaml'
Properties
$filePersistenceSlot read-only
protected
FilePersistenceSlot
$filePersistenceSlot
$resourceFactory read-only
protected
ResourceFactory
$resourceFactory
$runtimeCache read-only
protected
FrontendInterface
$runtimeCache
Attributes
- #[Autowire]
- $service: 'cache.runtime'
$storageConfiguration read-only
protected
PersistenceConfigurationService
$storageConfiguration
$storageRepository
protected
StorageRepository|null
$storageRepository
= null
$yamlSource read-only
protected
YamlSource
$yamlSource
Methods
__construct()
public
__construct(YamlSource $yamlSource, ResourceFactory $resourceFactory, PersistenceConfigurationService $storageConfiguration, FilePersistenceSlot $filePersistenceSlot, FrontendInterface $runtimeCache) : mixed
Parameters
- $yamlSource : YamlSource
- $resourceFactory : ResourceFactory
- $storageConfiguration : PersistenceConfigurationService
- $filePersistenceSlot : FilePersistenceSlot
- $runtimeCache : FrontendInterface
delete()
Delete form definition from storage
public
delete(FormIdentifier $identifier) : void
Parameters
- $identifier : FormIdentifier
exists()
public
exists(FormIdentifier $identifier) : bool
Parameters
- $identifier : FormIdentifier
Return values
boolfindAll()
public
findAll(SearchCriteria $criteria) : array<string|int, mixed>
Parameters
- $criteria : SearchCriteria
Return values
array<string|int, mixed>getAccessibleFormStorageFolders()
Return a list of all accessible file mountpoints for the current backend user.
public
getAccessibleFormStorageFolders() : array<string|int, Folder>
Only registered mount points from persistenceManager.allowedFileMounts are listed.
Return values
array<string|int, Folder>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)
getUniqueIdentifier()
This takes a form identifier and returns a unique identifier for it.
public
getUniqueIdentifier(string $identifier) : string
If a formDefinition with the same identifier already exists a suffix is appended until the identifier is unique.
Parameters
- $identifier : string
Tags
Return values
string —unique form identifier
getUniquePersistenceIdentifier()
This takes a form identifier and returns a unique persistence identifier for it.
public
getUniquePersistenceIdentifier(string $formIdentifier, string $savePath) : 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
- $savePath : 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
isAllowedPersistencePath()
Check if a persistence path or if a persistence identifier path is configured within the form setup "persistenceManager.allowedExtensionPaths" or persistenceManager.allowedFileMounts".
public
isAllowedPersistencePath(string $persistencePath) : bool
If the input is a persistence identifier an additional check for a valid file extension is performed.
Parameters
- $persistencePath : string
Return values
boolread()
Read form definition from storage
public
read(FormIdentifier $identifier) : FormData
Parameters
- $identifier : FormIdentifier
Return values
FormDatasupports()
Check if this adapter can handle the given persistence identifier
public
supports(string $identifier) : bool
Parameters
- $identifier : string
-
Persistence identifier (e.g., "EXT:my_ext/Forms/contact.form.yaml", "1:/forms/contact.form.yaml")
Return values
bool —True if this adapter can handle the identifier
write()
Write form definition to storage
public
write(FormIdentifier $identifier, FormData $data) : void
Parameters
- $identifier : FormIdentifier
- $data : FormData
checkForDuplicateIdentifier()
Check if an identifier is already used by a formDefinition.
protected
checkForDuplicateIdentifier(string $identifier) : bool
Parameters
- $identifier : string
Return values
boolensureValidPersistenceIdentifier()
protected
ensureValidPersistenceIdentifier(string $identifier) : void
Parameters
- $identifier : string
Tags
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
getOrCreateFile()
Returns a File object for a given $persistenceIdentifier.
protected
getOrCreateFile(string $persistenceIdentifier) : File
If no file for this identifier exists a new object will be created.
Parameters
- $persistenceIdentifier : string
Tags
Return values
FilegetStorageByUid()
Returns a ResourceStorage for a given uid
protected
getStorageByUid(int $storageUid) : ResourceStorage
Parameters
- $storageUid : int
Tags
Return values
ResourceStoragehasValidFileExtension()
protected
hasValidFileExtension(string $identifier) : bool
Parameters
- $identifier : string
Return values
boolisAccessibleFormStorageFolder()
protected
isAccessibleFormStorageFolder(string $folderName) : bool
Parameters
- $folderName : string
Return values
boolisFileWithinAccessibleFormStorageFolders()
protected
isFileWithinAccessibleFormStorageFolders(string $fileName) : bool
Parameters
- $fileName : string
Return values
boolloadMetaData()
protected
loadMetaData(string|File $fileOrIdentifier) : FormMetadata
Parameters
- $fileOrIdentifier : string|File
Return values
FormMetadatalooksLikeAFormDefinition()
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
Return values
boolpathIsIntendedAsFileMountPath()
protected
pathIsIntendedAsFileMountPath(string $path) : bool
Parameters
- $path : string
Return values
boolretrieveFileByPersistenceIdentifier()
protected
retrieveFileByPersistenceIdentifier(string $identifier) : File
Parameters
- $identifier : string