RawConfigurationTrait
Escape hatch for "open" configuration DTOs.
The "prototypes" section of the form YAML configuration is extensible by design: third-party extensions may register arbitrary form element types, inspector editors, finishers, validators, rendering options and custom properties. DTOs modelling that section therefore expose typed accessors for the well-known core keys only, while keeping the untouched raw configuration array reachable through this trait.
Consuming DTOs must declare a promoted constructor property array $raw
holding the original configuration array.
Table of Contents
Properties
- $raw : array<string, mixed>
Methods
- get() : mixed
- Read a value from the raw configuration using a dot-separated path.
- 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
$raw read-only
public
array<string, mixed>
$raw
Methods
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
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