API reference / Quittio \ Core \ Rendering
RenderOptions
final readonly class in quittio/core
Quittio\Core\Rendering\RenderOptions · Source
Per call options of a render run; unset values fall back to the configuration.
Constants#
| Constant | Value | Description |
|---|---|---|
ARRAY_VERSION | 1 | Version of the array format of toArray(). |
Properties#
| Property | Type | Description |
|---|---|---|
$country readonly | ?string | |
$formats readonly | list<string> | empty = configured or automatically chosen format |
$locale readonly | ?string | |
$options readonly | array<string, mixed> | |
$presentation readonly | ?Presentation | |
$profile readonly | Profile|string|null | |
$template readonly | ?string | |
$validation readonly | ?string |
Methods#
| Method | Description |
|---|---|
->__construct() | |
::fromArray() | |
->toArray() | The options as array of scalars, e.g. for a queued job; fromArray() restores them. A profile object is stored by its key, so it must be registered where the array is read. |
__construct()#
public function __construct(
list<string> $formats = [],
Profile|string|null $profile = null,
?string $template = null,
?string $locale = null,
?string $country = null,
?string $validation = null,
?Presentation $presentation = null,
array<string, mixed> $options = [],
)| Parameter | Type | Description |
|---|---|---|
$formats | list<string> = [] | empty = configured or automatically chosen format |
$profile | Profile|string|null = null | |
$template | ?string = null | |
$locale | ?string = null | |
$country | ?string = null | |
$validation | ?string = null | |
$presentation | ?Presentation = null | |
$options | array<string, mixed> = [] |
fromArray()#
public static function fromArray(array<array-key, mixed> $data): self| Parameter | Type | Description |
|---|---|---|
$data | array<array-key, mixed> | an array of toArray() |
- Returns
self- Throws
InvalidArgumentException– for an unknown version or invalid values
toArray()#
public function toArray(): array{_version: int, formats: list<string>, profile: ?string, template: ?string, locale: ?string, country: ?string, validation: ?string, presentation: ?array<string, mixed>, options: array<string, mixed>}The options as array of scalars, e.g. for a queued job; fromArray() restores them. A profile object is stored by its key, so it must be registered where the array is read.
- Returns
array{_version: int, formats: list<string>, profile: ?string, template: ?string, locale: ?string, country: ?string, validation: ?string, presentation: ?array<string, mixed>, options: array<string, mixed>}- Throws
InvalidArgumentException– when an option is not a scalar, null or an array of them