trait HasState (View source)

Traits

Properties

protected mixed $defaultState
protected mixed $getStateUsing
protected string|null $statePath
protected string|Closure|null $separator
protected bool|Closure $isDistinctList
protected string $cachedAbsoluteStatePath

Methods

bool
hasRelationship(Model $record)

No description

Relation|null
getRelationship(Model $record, string|null $statePath = null)

No description

array
getRelationshipResults(Model $record, array|null $relationships = null)

No description

string
getRelationshipAttribute(string|null $statePath = null)

No description

string|null
getRelationshipName(string|null $statePath = null)

No description

getStateUsing(mixed $callback)

No description

state(mixed $state)

No description

default(mixed $state)

No description

distinctList(bool|Closure $condition = true)

No description

bool
isDistinctList()

No description

mixed
getDefaultState()

No description

mixed
getState()

No description

separator(string|Closure|null $separator = ',')

No description

statePath(string|null $path)

No description

string|null
getSeparator()

No description

Model|null
getRecord()

No description

bool
hasStatePath()

No description

string
getStatePath(bool $isAbsolute = true)

No description

mixed
getStateFromRecord(Model $record)

No description

void
flushCachedAbsoluteStatePath()

No description

Details

bool hasRelationship(Model $record)

No description

Parameters

Model $record

Return Value

bool

Relation|null getRelationship(Model $record, string|null $statePath = null)

No description

Parameters

Model $record
string|null $statePath

Return Value

Relation|null

array getRelationshipResults(Model $record, array|null $relationships = null)

No description

Parameters

Model $record
array|null $relationships

Return Value

array

string getRelationshipAttribute(string|null $statePath = null)

No description

Parameters

string|null $statePath

Return Value

string

string|null getRelationshipName(string|null $statePath = null)

No description

Parameters

string|null $statePath

Return Value

string|null

HasState getStateUsing(mixed $callback)

No description

Parameters

mixed $callback

Return Value

HasState

HasState state(mixed $state)

No description

Parameters

mixed $state

Return Value

HasState

HasState default(mixed $state)

No description

Parameters

mixed $state

Return Value

HasState

HasState distinctList(bool|Closure $condition = true)

No description

Parameters

bool|Closure $condition

Return Value

HasState

bool isDistinctList()

No description

Return Value

bool

mixed getDefaultState()

No description

Return Value

mixed

mixed getState()

No description

Return Value

mixed

HasState separator(string|Closure|null $separator = ',')

No description

Parameters

string|Closure|null $separator

Return Value

HasState

HasState statePath(string|null $path)

No description

Parameters

string|null $path

Return Value

HasState

string|null getSeparator()

No description

Return Value

string|null

Model|null getRecord()

No description

Return Value

Model|null

bool hasStatePath()

No description

Return Value

bool

string getStatePath(bool $isAbsolute = true)

No description

Parameters

bool $isAbsolute

Return Value

string

mixed getStateFromRecord(Model $record)

No description

Parameters

Model $record

Return Value

mixed

protected void flushCachedAbsoluteStatePath()

No description

Return Value

void