Skip to content

API reference / Quittio \ Core \ Xml

XmlSerializer

interface in quittio/core

Quittio\Core\Xml\XmlSerializer · Source

Writes calculated invoice data as XML in one syntax.

Methods#

MethodDescription
->serialize()Writes the calculated invoice as XML of this syntax for $profile; throws CalculationException if the invoice is not calculated.
->syntax()The XML syntax this serializer writes, e.g. CII or UBL.

serialize()#

public function serialize(
    InvoiceData $invoice,
    Profile $profile,
    SerializationOptions $options = new \Quittio\Core\Xml\SerializationOptions(),
): string

Writes the calculated invoice as XML of this syntax for $profile; throws CalculationException if the invoice is not calculated.

ParameterTypeDescription
$invoiceInvoiceData
$profileProfile
$optionsSerializationOptions = new \Quittio\Core\Xml\SerializationOptions()
Returns
string

syntax()#

public function syntax(): Syntax

The XML syntax this serializer writes, e.g. CII or UBL.

Returns
Syntax

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