Skip to content

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#

ConstantValueDescription
ARRAY_VERSION1Version of the array format of toArray().

Properties#

PropertyTypeDescription
$country readonly?string
$formats readonlylist<string>empty = configured or automatically chosen format
$locale readonly?string
$options readonlyarray<string, mixed>
$presentation readonly?Presentation
$profile readonlyProfile|string|null
$template readonly?string
$validation readonly?string

Methods#

MethodDescription
->__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 = [],
)
ParameterTypeDescription
$formatslist<string> = []empty = configured or automatically chosen format
$profileProfile|string|null = null
$template?string = null
$locale?string = null
$country?string = null
$validation?string = null
$presentation?Presentation = null
$optionsarray<string, mixed> = []

fromArray()#

public static function fromArray(array<array-key, mixed> $data): self

static

ParameterTypeDescription
$dataarray<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

The open core packages are MIT licensed. The legal wording of the country packs must be confirmed by a tax adviser.