API reference / Quittio \ Core \ Builder \ Concerns
BuildsPresentationAndMeta
trait in quittio/core
Quittio\Core\Builder\Concerns\BuildsPresentationAndMeta · Source
Presentation, locale, time zone, custom values, flags and the source of the invoice.
Part of InvoiceBuilder, which holds the state; use the builder, not the trait.
Methods#
| Method | Description |
|---|---|
->custom() | Free data for templates (view model key meta.custom); the same key replaces the value. |
->flag() | Sets a flag that country packs evaluate (e.g. a small amount invoice in Germany). |
->locale() | Language of the invoice: labels, generated texts and the exemption texts of presets. The locale of a render call wins; without both, the configured locale or the country default. |
->presentation() | Design of this invoice in PDF and HTML: a Presentation replaces it, an array changes single values (->presentation(['introText' => 'Thank you for your order.', 'showGrossPrices' => true])), a callable receives the current Presentation and returns the new one. |
->source() | Origin of the data, e.g. "shop" (view model key meta.source). |
->timezone() | Time zone for DateTimeInterface values and for the default issue date; call it before the date setters. |
custom()#
public function custom(string $key, mixed $value): staticFree data for templates (view model key meta.custom); the same key replaces the value.
| Parameter | Type | Description |
|---|---|---|
$key | string | |
$value | mixed |
- Returns
static
flag()#
public function flag(string $flag, bool $enabled = true): staticSets a flag that country packs evaluate (e.g. a small amount invoice in Germany).
| Parameter | Type | Description |
|---|---|---|
$flag | string | |
$enabled | bool = true |
- Returns
static
locale()#
public function locale(string $locale): staticLanguage of the invoice: labels, generated texts and the exemption texts of presets. The locale of a render call wins; without both, the configured locale or the country default.
| Parameter | Type | Description |
|---|---|---|
$locale | string |
- Returns
static
presentation()#
public function presentation(Presentation|array|callable $presentation): staticDesign of this invoice in PDF and HTML: a Presentation replaces it, an array changes single values (->presentation(['introText' => 'Thank you for your order.', 'showGrossPrices' => true])), a callable receives the current Presentation and returns the new one.
| Parameter | Type | Description |
|---|---|---|
$presentation | Presentation|array|callable |
- Returns
static
source()#
public function source(string $source): staticOrigin of the data, e.g. "shop" (view model key meta.source).
| Parameter | Type | Description |
|---|---|---|
$source | string |
- Returns
static
timezone()#
public function timezone(string $timezone): staticTime zone for DateTimeInterface values and for the default issue date; call it before the date setters.
| Parameter | Type | Description |
|---|---|---|
$timezone | string |
- Returns
static