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
Internal

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

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)

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


        
On this page

Search results