StorageAdapterInterface
Storage adapter interface for form persistence
Storage adapters are responsible for reading, writing, and finding form definitions from various storage backends (file mounts, extensions, database, etc.).
Adapters are selected using the Chain of Responsibility pattern:
- Each adapter declares what identifiers it can handle via supports()
- Factory iterates through adapters by priority until one matches
- This allows third-party extensions to register custom storage adapters
Table of Contents
Methods
- delete() : void
- Delete form definition from storage
- exists() : bool
- Check if form definition exists in storage
- findAll() : array<string|int, FormMetadata>
- Find all form definitions matching the search criteria
- getPriority() : int
- Get priority for capability checking
- getTypeIdentifier() : string
- Get unique identifier for this storage type
- 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
Methods
delete()
Delete form definition from storage
public
delete(FormIdentifier $identifier) : void
Parameters
- $identifier : FormIdentifier
Tags
exists()
Check if form definition exists in storage
public
exists(FormIdentifier $identifier) : bool
Parameters
- $identifier : FormIdentifier
Return values
boolfindAll()
Find all form definitions matching the search criteria
public
findAll(SearchCriteria $criteria) : array<string|int, FormMetadata>
Parameters
- $criteria : SearchCriteria
Return values
array<string|int, FormMetadata>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)
read()
Read form definition from storage
public
read(FormIdentifier $identifier) : FormData
Parameters
- $identifier : FormIdentifier
Tags
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