HasState
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
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
distinctList(bool|Closure $condition = true)
No description
bool
isDistinctList()
No description
mixed
getDefaultState()
No description
mixed
getState()
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
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
HasState
getStateUsing(mixed $callback)
No description
HasState
state(mixed $state)
No description
HasState
default(mixed $state)
No description
HasState
distinctList(bool|Closure $condition = true)
No description
bool
isDistinctList()
No description
mixed
getDefaultState()
No description
mixed
getState()
No description
HasState
separator(string|Closure|null $separator = ',')
No description
HasState
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
protected void
flushCachedAbsoluteStatePath()
No description