API reference / Quittio \ Core \ Rendering
PreparedInvoice
final readonly class in quittio/core
Quittio\Core\Rendering\PreparedInvoice · Source
Calculated and validated invoice data plus the decisions a render run would take (format, profile, country pack, locale), without rendering anything. The XML of every format (also the one "pdf" embeds with b2cEmbedXml) is generated for the validation only. Used by the Managed layer to freeze an invoice before its documents are rendered; the validation always runs, whatever the validation mode.
Properties#
| Property | Type | Description |
|---|---|---|
$buyerCountry readonly | ?CountryPack | |
$country readonly | CountryPack | |
$data readonly | InvoiceData | |
$formats readonly | array<string, Profile|null> | format key => profile (null for formats that write or embed no XML) |
$locale readonly | string | |
$validation readonly | ValidationResult |
Methods#
| Method | Description |
|---|---|
->__construct() | |
->format() | Key of the main format, the first of $formats as in a render run. |
->profile() | Profile of the main format; null for formats that write or embed no XML. |
__construct()#
public function __construct(
InvoiceData $data,
array<string, Profile|null> $formats,
CountryPack $country,
?CountryPack $buyerCountry,
string $locale,
ValidationResult $validation,
)| Parameter | Type | Description |
|---|---|---|
$data | InvoiceData | |
$formats | array<string, Profile|null> | format key => profile (null for formats that write or embed no XML) |
$country | CountryPack | |
$buyerCountry | ?CountryPack | |
$locale | string | |
$validation | ValidationResult |
format()#
public function format(): stringKey of the main format, the first of $formats as in a render run.
- Returns
string
profile()#
public function profile(): ?ProfileProfile of the main format; null for formats that write or embed no XML.
- Returns
?Profile