Skip to content

API reference / Quittio \ Core \ Reading

FormatReader

interface in quittio/core

Quittio\Core\Reading\FormatReader · Source

Reads one XML invoice format into the data model.

Methods#

MethodDescription
->canRead()Whether the reader handles the document, judged by its root element and namespace. InvoiceReader uses the first reader that returns true.
->read()Maps the document into the data model; $xml is the XML the document was loaded from and goes into the result.

canRead()#

public function canRead(DOMDocument $document): bool

Whether the reader handles the document, judged by its root element and namespace. InvoiceReader uses the first reader that returns true.

ParameterTypeDescription
$documentDOMDocument
Returns
bool

read()#

public function read(DOMDocument $document, string $xml): ReadResult

Maps the document into the data model; $xml is the XML the document was loaded from and goes into the result.

ParameterTypeDescription
$documentDOMDocument
$xmlstring
Returns
ReadResult

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