FileMountStorageAdapter extends AbstractFileStorageAdapter implements StorageAdapterInterface

Storage adapter for filemount-based form persistence

Internal

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

Methods

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

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

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
bool

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_ext/Forms/contact.form.yaml", "1:/forms/contact.form.yaml")

Return values
bool

True if this adapter can handle the identifier

checkForDuplicateIdentifier()

Check if an identifier is already used by a formDefinition.

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

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

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

hasValidFileExtension()

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

isAccessibleFormStorageFolder()

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

isFileWithinAccessibleFormStorageFolders()

protected isFileWithinAccessibleFormStorageFolders(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

pathIsIntendedAsFileMountPath()

protected pathIsIntendedAsFileMountPath(string $path) : bool
Parameters
$path : string
Return values
bool

        
On this page

Search results