PrototypeConfiguration uses RawConfigurationTrait

Read onlyYes
FinalYes

Typed representation of a single prototype within the "prototypes" section of the form YAML configuration (e.g. "prototypes.standard").

This is an "open" DTO: a prototype is fully extensible by third-party extensions (custom form element types, finishers, validators, rendering options, …). Only the well-known core sub-trees are exposed as typed accessors; everything else stays reachable through RawConfigurationTrait::getRaw() / ::get().

Internal

Table of Contents

Properties

$finishers  : FinisherDefinitionCollection
$formEditor  : FormEditorConfiguration
$formElements  : FormElementDefinitionCollection
$formEngine  : FormEngineDefinition|null
$raw  : array<string|int, mixed>

Methods

__construct()  : mixed
fromArray()  : self
Create the DTO from the raw prototype configuration array.
get()  : mixed
Read a value from the raw configuration using a dot-separated path.
getFormEditorDefinitions()  : array<string, array<string, mixed>>
Reduce the definition registries to their form editor configuration.
getRaw()  : array<string, mixed>
Return the complete raw configuration array this DTO was built from.
has()  : bool
Check whether the given dot-separated path exists in the raw configuration.

Properties

Methods

__construct()

public __construct(array<string, mixed> $raw, FormEditorConfiguration $formEditor, FormElementDefinitionCollection $formElements, FinisherDefinitionCollection $finishers, FormEngineDefinition|null $formEngine) : mixed
Parameters
$raw : array<string, mixed>

The complete, untouched prototype configuration array

$formEditor : FormEditorConfiguration

Typed "formEditor" sub configuration

$formElements : FormElementDefinitionCollection

Typed form element registry

$finishers : FinisherDefinitionCollection

Typed finisher registry

$formEngine : FormEngineDefinition|null

Typed prototype-level FormEngine configuration

fromArray()

Create the DTO from the raw prototype configuration array.

public static fromArray(array<string, mixed> $configuration) : self
Parameters
$configuration : array<string, mixed>
Return values
self

get()

Read a value from the raw configuration using a dot-separated path.

public get(string $path[, mixed $default = null ]) : mixed

Example: $dto->get('formEditor.dynamicJavaScriptModules.app').

Parameters
$path : string
$default : mixed = null

getFormEditorDefinitions()

Reduce the definition registries to their form editor configuration.

public getFormEditorDefinitions() : array<string, array<string, mixed>>
Return values
array<string, array<string, mixed>>

getRaw()

Return the complete raw configuration array this DTO was built from.

public getRaw() : array<string, mixed>

Use this to reach custom keys that are not (yet) mapped to typed properties, e.g. properties registered by third-party extensions.

Return values
array<string, mixed>

has()

Check whether the given dot-separated path exists in the raw configuration.

public has(string $path) : bool
Parameters
$path : string
Return values
bool
On this page

Search results