trait EntanglesStateWithSingularRelationship (View source)

Properties

protected Model|null $cachedExistingRecord
protected string|null $relationship
protected Closure|null $mutateRelationshipDataBeforeCreateUsing
protected Closure|null $mutateRelationshipDataBeforeFillUsing
protected Closure|null $mutateRelationshipDataBeforeSaveUsing

Methods

relationship(string $relationshipName, bool|Closure $condition = true)

No description

void
fillFromRelationship()

No description

array
getStateFromRelatedRecord(Model $record)

No description

getChildComponentContainer($key = null)

No description

MorphOne|null
getRelationship()

No description

string|null
getRelationshipName()

No description

string|null
getRelatedModel()

No description

Model|null
getCachedExistingRecord()

No description

void
clearCachedExistingRecord()

No description

array
mutateRelationshipDataBeforeCreate(array $data)

No description

array
mutateRelationshipDataBeforeFill(array $data)

No description

array
mutateRelationshipDataBeforeSave(array $data)

No description

Details

EntanglesStateWithSingularRelationship relationship(string $relationshipName, bool|Closure $condition = true)

No description

Parameters

string $relationshipName
bool|Closure $condition

Return Value

EntanglesStateWithSingularRelationship

void fillFromRelationship()

No description

Return Value

void

protected array getStateFromRelatedRecord(Model $record)

No description

Parameters

Model $record

Return Value

array

ComponentContainer getChildComponentContainer($key = null)

No description

Parameters

$key

Return Value

ComponentContainer

MorphOne|null getRelationship()

No description

Return Value

MorphOne|null

string|null getRelationshipName()

No description

Return Value

string|null

string|null getRelatedModel()

No description

Return Value

string|null

EntanglesStateWithSingularRelationship cachedExistingRecord(Model|null $record)

No description

Parameters

Model|null $record

Return Value

EntanglesStateWithSingularRelationship

Model|null getCachedExistingRecord()

No description

Return Value

Model|null

void clearCachedExistingRecord()

No description

Return Value

void

EntanglesStateWithSingularRelationship mutateRelationshipDataBeforeCreateUsing(Closure|null $callback)

No description

Parameters

Closure|null $callback

Return Value

EntanglesStateWithSingularRelationship

array mutateRelationshipDataBeforeCreate(array $data)

No description

Parameters

array $data

Return Value

array

EntanglesStateWithSingularRelationship mutateRelationshipDataBeforeSaveUsing(Closure|null $callback)

No description

Parameters

Closure|null $callback

Return Value

EntanglesStateWithSingularRelationship

array mutateRelationshipDataBeforeFill(array $data)

No description

Parameters

array $data

Return Value

array

EntanglesStateWithSingularRelationship mutateRelationshipDataBeforeFillUsing(Closure|null $callback)

No description

Parameters

Closure|null $callback

Return Value

EntanglesStateWithSingularRelationship

array mutateRelationshipDataBeforeSave(array $data)

No description

Parameters

array $data

Return Value

array