Documentation

LedgerCurrency extends Model
in package
Uses CommonResponseProperties, HasFactory, HasRevisions

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
__get()  : HigherOrderCollectionProxy|mixed|string|null
The revision Hash is computationally expensive, only calculated when required.
checkRevision()  : mixed
Throw a Breaker exception if the request revision doesn't match the stored value.
clearRevisionCache()  : void
createFromMessage()  : self
findOrBreaker()  : LedgerCurrency
Look for a currency. If not found throw a Breaker.
getRevisionHash()  : mixed
refresh()  : mixed
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

__get()

The revision Hash is computationally expensive, only calculated when required.

public __get( $key) : HigherOrderCollectionProxy|mixed|string|null
Parameters
$key :
Tags
throws
Exception
Return values
HigherOrderCollectionProxy|mixed|string|null

checkRevision()

Throw a Breaker exception if the request revision doesn't match the stored value.

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

clearRevisionCache()

public clearRevisionCache() : void
Return values
void

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

getRevisionHash()

public getRevisionHash() : mixed
Return values
mixed

refresh()

public refresh() : mixed
Return values
mixed

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