Methods |
public
|
__construct(Builder $query, Model $child, string $foreignKey, string $ownerKey, string $relationName): void
Create a new belongs to relationship instance.
Create a new belongs to relationship instance.
Overrides
Overriden by
|
#
|
public
|
getResults(): mixed
Get the results of the relationship.
Get the results of the relationship.
Implements
|
#
|
public
|
addConstraints(): void
Set the base constraints on the relation query.
Set the base constraints on the relation query.
Implements
|
#
|
public
|
addEagerConstraints(array $models): void
Set the constraints for an eager load of the relation.
Set the constraints for an eager load of the relation.
Overriden by
Implements
|
#
|
public
|
initRelation(array $models, string $relation): array
Initialize the relation on a set of models.
Initialize the relation on a set of models.
Implements
|
#
|
public
|
match(array $models, Collection $results, string $relation): array
Match the eagerly loaded results to their parents.
Match the eagerly loaded results to their parents.
Overriden by
Implements
|
#
|
public
|
associate(Model|int|string|null $model): Model
Associate the model instance to the given parent.
Associate the model instance to the given parent.
Overriden by
|
#
|
public
|
dissociate(): Model
Dissociate previously associated model from the given parent.
Dissociate previously associated model from the given parent.
Overriden by
|
#
|
public
|
disassociate(): Model
Alias of "dissociate" method.
Alias of "dissociate" method.
|
#
|
public
|
getRelationExistenceQuery(Builder $query, Builder $parentQuery, array|mixed $columns = ['*']): Builder
Add the constraints for a relationship query.
Add the constraints for a relationship query.
Overrides
|
#
|
public
|
getRelationExistenceQueryForSelfRelation(Builder $query, Builder $parentQuery, array|mixed $columns = ['*']): Builder
Add the constraints for a relationship query on the same table.
Add the constraints for a relationship query on the same table.
|
#
|
public
|
getChild(): Model
Get the child of the relationship.
Get the child of the relationship.
|
#
|
public
|
getForeignKeyName(): string
Get the foreign key of the relationship.
Get the foreign key of the relationship.
|
#
|
public
|
getQualifiedForeignKeyName(): string
Get the fully qualified foreign key of the relationship.
Get the fully qualified foreign key of the relationship.
|
#
|
public
|
getParentKey(): mixed
Get the key value of the child's foreign key.
Get the key value of the child's foreign key.
|
#
|
public
|
getOwnerKeyName(): string
Get the associated key of the relationship.
Get the associated key of the relationship.
|
#
|
public
|
getQualifiedOwnerKeyName(): string
Get the fully qualified associated key of the relationship.
Get the fully qualified associated key of the relationship.
|
#
|
public
|
getRelationName(): string
Get the name of the relationship.
Get the name of the relationship.
|
#
|