Documentation

LedgerCurrency extends Model
in package
Uses CommonResponseProperties, HasFactory

Currencies available to the ledger.

Tags
mixin

Builder

mixin

\Illuminate\Database\Query\Builder

Table of Contents

AMOUNT_SIZE  = 32
CODE_SIZE  = 16
$code  : string
$created_at  : Carbon
$decimals  : int
$incrementing  : mixed
$primaryKey  : mixed
$revision  : Carbon
$updated_at  : Carbon
checkRevision()  : mixed
createFromMessage()  : self
findOrBreaker()  : LedgerCurrency
Look for a currency. If not found throw a Breaker.
toResponse()  : array<string|int, mixed>
Convert to a response array.

Constants

Properties

$created_at

public Carbon $created_at

When the record was created.

$revision

public Carbon $revision

Revision timestamp to detect race condition on update.

$updated_at

public Carbon $updated_at

When the record was updated.

Methods

checkRevision()

public checkRevision(string|null $revision) : mixed
Parameters
$revision : string|null
Tags
throws
Breaker
throws
Exception
Return values
mixed

findOrBreaker()

Look for a currency. If not found throw a Breaker.

public static findOrBreaker(string $currency[, int|null $errorCode = Breaker::BAD_REQUEST ]) : LedgerCurrency
Parameters
$currency : string

Currency code.

$errorCode : int|null = Breaker::BAD_REQUEST

Breaker code (default to bad request).

Tags
throws
Breaker
Return values
LedgerCurrency

toResponse()

Convert to a response array.

public toResponse([array<string|int, mixed> $options = [] ]) : array<string|int, mixed>
Parameters
$options : array<string|int, mixed> = []
Tags
throws
Exception
Return values
array<string|int, mixed>

Search results