trait ComparesRelatedModels

Methods

bool
is(Model|null $model)

Determine if the model is the related instance of the relationship.

bool
isNot(Model|null $model)

Determine if the model is not the related instance of the relationship.

mixed
getParentKey()

Get the value of the parent model's key.

mixed
getRelatedKeyFrom(Model $model)

Get the value of the model's related key.

bool
compareKeys(mixed $parentKey, mixed $relatedKey)

Compare the parent key with the related key.

Details

at line 15
bool is(Model|null $model)

Determine if the model is the related instance of the relationship.

Parameters

Model|null $model

Return Value

bool

at line 34
bool isNot(Model|null $model)

Determine if the model is not the related instance of the relationship.

Parameters

Model|null $model

Return Value

bool

at line 42
abstract mixed getParentKey()

Get the value of the parent model's key.

Return Value

mixed

at line 47
abstract protected mixed getRelatedKeyFrom(Model $model)

Get the value of the model's related key.

Parameters

Model $model

Return Value

mixed

at line 52
protected bool compareKeys(mixed $parentKey, mixed $relatedKey)

Compare the parent key with the related key.

Parameters

mixed $parentKey
mixed $relatedKey

Return Value

bool