Quittio 0.3 API

RenderedInvoice
in package

FinalYes

Result of a render run. With several formats, every format is reachable via {@see self::as()}; all share the same calculation.

Table of Contents

Methods

__construct()  : mixed
as()  : self
The result for another format of the same run.
contents()  : string
The main output: PDF, otherwise XML, HTML or JSON.
data()  : InvoiceData
The calculated invoice data of the run (totals, VAT breakdown, due date).
extension()  : string
Extension of the main output (contents()): pdf, xml, html or json.
filename()  : string
File name of the main output, from the configured pattern; $extension replaces the extension of the main output.
format()  : string
Key of the format of this result, e.g. "zugferd".
formats()  : array<int, string>
hashes()  : array<string, string>
SHA-256 hashes of the outputs, e.g. for archiving.
hasPdf()  : bool
Whether this format produced a PDF.
hasXml()  : bool
Whether this format produced XML (also the XML embedded in a PDF).
html()  : string
The rendered template, as mPDF received it.
json()  : string
The invoice as JSON (InvoiceData::toJson()).
mimeType()  : string
MIME type of the main output (contents()).
pdf()  : string
The PDF.
profile()  : Profile|null
Profile of the XML; null for formats without XML.
save()  : string
Writes the main output. A directory as target uses {@see self::filename()}.
validation()  : ValidationResult
Validation result of this format; in the mode "warn" it may contain errors, empty in the mode "off".
xml()  : string
The e-invoice XML, also the one embedded in the PDF.

Methods

__construct()

public __construct(InvoiceData $data, string $format, Profile|null $profile, ValidationResult $validation, string $filenamePattern[, string|null $xml = null ][, string|null $pdf = null ][, string|null $html = null ][, string|null $json = null ]) : mixed
Parameters
$data : InvoiceData
$format : string
$profile : Profile|null
$validation : ValidationResult
$filenamePattern : string

file name with the placeholder {ext}

$xml : string|null = null
$pdf : string|null = null
$html : string|null = null
$json : string|null = null

as()

The result for another format of the same run.

public as(string $format) : self
Parameters
$format : string
Return values
self

contents()

The main output: PDF, otherwise XML, HTML or JSON.

public contents() : string
Return values
string

extension()

Extension of the main output (contents()): pdf, xml, html or json.

public extension() : string
Return values
string

filename()

File name of the main output, from the configured pattern; $extension replaces the extension of the main output.

public filename([string|null $extension = null ]) : string
Parameters
$extension : string|null = null
Return values
string

format()

Key of the format of this result, e.g. "zugferd".

public format() : string
Return values
string

formats()

public formats() : array<int, string>
Return values
array<int, string>

hashes()

SHA-256 hashes of the outputs, e.g. for archiving.

public hashes() : array<string, string>
Return values
array<string, string>

hasPdf()

Whether this format produced a PDF.

public hasPdf() : bool
Return values
bool

hasXml()

Whether this format produced XML (also the XML embedded in a PDF).

public hasXml() : bool
Return values
bool

html()

The rendered template, as mPDF received it.

public html() : string
Tags
throws
LogicException

when the format produced no HTML

Return values
string

json()

The invoice as JSON (InvoiceData::toJson()).

public json() : string
Return values
string

mimeType()

MIME type of the main output (contents()).

public mimeType() : string
Return values
string

save()

Writes the main output. A directory as target uses {@see self::filename()}.

public save(string $path) : string
Parameters
$path : string
Return values
string —

the written path

xml()

The e-invoice XML, also the one embedded in the PDF.

public xml() : string
Tags
throws
LogicException

when the format produces no XML (see hasXml())

Return values
string
On this page

Search results