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#
| Method | Description |
|---|---|
->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): boolWhether the reader handles the document, judged by its root element and namespace. InvoiceReader uses the first reader that returns true.
| Parameter | Type | Description |
|---|---|---|
$document | DOMDocument |
- Returns
bool
read()#
public function read(DOMDocument $document, string $xml): ReadResultMaps the document into the data model; $xml is the XML the document was loaded from and goes into the result.
| Parameter | Type | Description |
|---|---|---|
$document | DOMDocument | |
$xml | string |
- Returns
ReadResult