API reference / Quittio \ Core \ Xml \ Ubl
UblReader
final class in quittio/core · implements FormatReader
Quittio\Core\Xml\Ubl\UblReader · Source
Reads UBL 2.1 Invoice and CreditNote documents (EN 16931, XRechnung UBL, Peppol BIS) into the data model.
Methods#
| Method | Description |
|---|---|
->canRead() | Whether the root element is a UBL 2.1 Invoice or CreditNote in its namespace. |
->read() | Reads the UBL document into invoice data, with the declared totals and VAT breakdown unchanged and the findings of reading. $xml is the source text of $document, kept in the result. |
canRead()#
public function canRead(DOMDocument $document): boolWhether the root element is a UBL 2.1 Invoice or CreditNote in its namespace.
| Parameter | Type | Description |
|---|---|---|
$document | DOMDocument |
- Returns
bool
read()#
public function read(DOMDocument $document, string $xml): ReadResultReads the UBL document into invoice data, with the declared totals and VAT breakdown unchanged and the findings of reading. $xml is the source text of $document, kept in the result.
| Parameter | Type | Description |
|---|---|---|
$document | DOMDocument | |
$xml | string |
- Returns
ReadResult