Quittio 0.3 API

RenderDocument
in package
implements ShouldQueue uses InteractsWithQueue, Queueable

FinalYes

Renders a quote, delivery note, reminder or other document in the queue and stores it on a disk. The document travels as versioned JSON snapshot (DocumentData::toSnapshot(), brought up to date by quittio.snapshots.document_upcasters), the render options as versioned JSON.

Errors that another attempt cannot fix fail the job at once; others are retried.

Table of Contents

Interfaces

ShouldQueue

Constants

PERMANENT_ERRORS  : array<string|int, mixed> = [\Quittio\Core\Calculation\CalculationException...
Exceptions that fail the job without a further attempt.

Properties

$backoff  : array<int, int>
$disk  : string|null
$document  : string
$options  : string
$path  : string|null
$tries  : int

Methods

__construct()  : mixed
data()  : DocumentData
The document of the job, upcast with the document upcasters of the application.
failed()  : void
Called by the queue worker when the job failed for good.
handle()  : void
Renders the document with the events of a render run, stores it and dispatches QueuedDocumentStored.
middleware()  : array<int, object>
of()  : self
The job of a document and its render options.
renderOptions()  : RenderOptions
The render options of the job.

Constants

PERMANENT_ERRORS

Exceptions that fail the job without a further attempt.

public array<string|int, mixed> PERMANENT_ERRORS = [\Quittio\Core\Calculation\CalculationException::class, \Quittio\Core\Exceptions\ConfigurationException::class, \Quittio\Core\Exceptions\HydrationException::class, \Quittio\Core\Serialization\Snapshots\SnapshotVersionException::class, \Quittio\Core\Exceptions\InvalidArgumentException::class, \JsonException::class]

Properties

$backoff

public array<int, int> $backoff = [10, 60]

seconds before the second and the third attempt

Methods

__construct()

public __construct(string $document, string $options[, string|null $disk = null ][, string|null $path = null ]) : mixed
Parameters
$document : string

JSON of DocumentData::toSnapshot()

$options : string

JSON of RenderOptions::toArray()

$disk : string|null = null
$path : string|null = null

failed()

Called by the queue worker when the job failed for good.

public failed(Throwable $exception) : void
Parameters
$exception : Throwable

middleware()

public middleware() : array<int, object>
Return values
array<int, object>

of()

The job of a document and its render options.

public static of(DocumentData $document, RenderOptions $options[, string|null $disk = null ][, string|null $path = null ]) : self
Parameters
$document : DocumentData
$options : RenderOptions
$disk : string|null = null
$path : string|null = null
Return values
self
On this page

Search results