class Entity extends Model implements Recyclable

Class Entity

Traits

Properties

protected array $fillable

The attributes that are mass assignable.

Currency $currency
string $name
bool $multi_currency
int $year_start
Carbon $destroyed_at
Carbon $deleted_at

Methods

static void
bootRecycling()

Model recycling events.

MorphMany
recycled()

Recycled Model records.

getTable()

Determine the model table name

belongsTo
currency()

Entity's Reporting Currency.

string
toString($type = false)

Instance Identifier.

HasOne
parent()

Model's Parent Entity (if exists).

HasOne
daughters()

Model's Daughter Entities (if any).

HasMany
users()

Users associated with the reporting Entity.

hasMany
currencies()

Entity's Registered Currencies.

HasMany
reportingPeriods()

Entity's Reporting Periods.

object
attributes()

Entity attributes

getDefaultRateAttribute()

Reporting Currency Default Rate.

void
assertAccessible()

Confirm the logged in User can work with the Entity. The EntityScope restricts every query to the User's Entity, so asking for another one would otherwise silently come back empty. Nobody being logged in, as on the console, is fine.

getCurrentReportingPeriodAttribute()

Current Reporting Period for the Entity.

getReportingCurrencyAttribute()

Reporting Currency for the Entity.

string
localizeAmount(float $amount, string|null $currencyCode = null, string $locale = null)

Format the given amount and currency according to the given locale.

bool
save(array $options = [])

Validate Entity.

Details

in Recycling at line 28
static void bootRecycling()

Model recycling events.

Return Value

void

in Recycling at line 73
MorphMany recycled()

Recycled Model records.

Return Value

MorphMany

in ModelTablePrefix at line 22
getTable()

Determine the model table name

at line 65
belongsTo currency()

Entity's Reporting Currency.

Return Value

belongsTo

at line 75
string toString($type = false)

Instance Identifier.

Parameters

$type

Return Value

string

at line 86
HasOne parent()

Model's Parent Entity (if exists).

Return Value

HasOne

at line 96
HasOne daughters()

Model's Daughter Entities (if any).

Return Value

HasOne

at line 106
HasMany users()

Users associated with the reporting Entity.

Return Value

HasMany

at line 116
hasMany currencies()

Entity's Registered Currencies.

Return Value

hasMany

at line 126
HasMany reportingPeriods()

Entity's Reporting Periods.

Return Value

HasMany

at line 136
object attributes()

Entity attributes

Return Value

object

at line 146
ExchangeRate getDefaultRateAttribute()

Reporting Currency Default Rate.

Return Value

ExchangeRate

at line 179
void assertAccessible()

Confirm the logged in User can work with the Entity. The EntityScope restricts every query to the User's Entity, so asking for another one would otherwise silently come back empty. Nobody being logged in, as on the console, is fine.

Return Value

void

at line 191
ReportingPeriod getCurrentReportingPeriodAttribute()

Current Reporting Period for the Entity.

Return Value

ReportingPeriod

at line 218
Currency getReportingCurrencyAttribute()

Reporting Currency for the Entity.

Return Value

Currency

at line 235
string localizeAmount(float $amount, string|null $currencyCode = null, string $locale = null)

Format the given amount and currency according to the given locale.

Parameters

float $amount
string|null $currencyCode
string $locale

Return Value

string

at line 251
bool save(array $options = [])

Validate Entity.

Parameters

array $options

Return Value

bool