CoolCMS API

ConfirmResult
in package

FinalYes

Outcome of {@see \App\UI\Api\Store\Models\Services\ReservationService::confirm()}.

Value object, not a DI service (the *DTO* folder is excluded from DI scanning).

On success it carries the posted issue document. alreadyConfirmed is true when an existing issue document of the source was returned unchanged (idempotent second call or retried webhook, caught by the uq_stock_documents_confirm safety net or the idempotence check under the lock).

On failure errorCode is 'noActiveReservations' (nothing usable to confirm; never a silent oversell, the caller decides whether to re-reserve or issue) or 'sourceLocked'.

Table of Contents

Properties

$alreadyConfirmed  : bool
$documentId  : int|null
$errorCode  : string|null
$number  : string|null
$success  : bool
$warnings  : array<string|int, mixed>

Methods

__construct()  : mixed
error()  : self
ok()  : self

Properties

$alreadyConfirmed read-only

public bool $alreadyConfirmed = false

$warnings read-only

public array<string|int, mixed> $warnings = []

Methods

__construct()

public __construct(bool $success[, int|null $documentId = null ][, string|null $number = null ][, bool $alreadyConfirmed = false ][, string|null $errorCode = null ][, array<int, string> $warnings = [] ]) : mixed
Parameters
$success : bool
$documentId : int|null = null
$number : string|null = null
$alreadyConfirmed : bool = false
$errorCode : string|null = null
$warnings : array<int, string> = []

error()

public static error(string $errorCode) : self
Parameters
$errorCode : string
Return values
self

ok()

public static ok(int $documentId, string|null $number[, bool $alreadyConfirmed = false ][, array<int, string> $warnings = [] ]) : self
Parameters
$documentId : int
$number : string|null
$alreadyConfirmed : bool = false
$warnings : array<int, string> = []
Return values
self
On this page

Search results