Zum Inhalt springen

API reference / Quittio \ Core \ Rendering

RenderedDocument

final readonly class in quittio/core

Quittio\Core\Rendering\RenderedDocument · Source

Rendered quote, delivery note, reminder or other document (PDF and HTML, never XML).

Methods#

MethodDescription
->__construct()
->contents()
->data()
->filename()
->hasPdf()
->html()
->mimeType()
->notices()Plausibility hints on the document, in the language of the run, e.g. a reminder that claims reminder fees besides the flat rate (DocumentData::notices()).
->pdf()
->save()Writes the output to a file, or into a directory (an existing one or a path ending in "/") with filename(); creates missing directories.

__construct()#

public function __construct(
    DocumentData $data,
    string $html,
    string $filenamePattern,
    ?string $pdf = null,
    list<ValidationMessage> $notices = [],
)
ParameterTypeDescription
$dataDocumentData
$htmlstring
$filenamePatternstring
$pdf?string = null
$noticeslist<ValidationMessage> = []plausibility hints on the document (DocumentData::notices())

contents()#

public function contents(): string
Returns
string

data()#

public function data(): DocumentData
Returns
DocumentData

filename()#

public function filename(?string $extension = null): string
ParameterTypeDescription
$extension?string = null
Returns
string

hasPdf()#

public function hasPdf(): bool
Returns
bool

html()#

public function html(): string
Returns
string

mimeType()#

public function mimeType(): string
Returns
string

notices()#

public function notices(): list<ValidationMessage>

Plausibility hints on the document, in the language of the run, e.g. a reminder that claims reminder fees besides the flat rate (DocumentData::notices()).

Returns
list<ValidationMessage>

pdf()#

public function pdf(): string
Returns
string

save()#

public function save(string $path): string

Writes the output to a file, or into a directory (an existing one or a path ending in "/") with filename(); creates missing directories.

ParameterTypeDescription
$pathstring
Returns
string – the written path

Die Open-Core-Pakete stehen unter der MIT-Lizenz. Die rechtlichen Formulierungen der Länderpakete sind mit einer Steuerberatung abzustimmen.