Метод |
Описание |
|
__construct ( Builder $query, Model $parent, string $foreignKey, string $relation ) : void |
Create a new has many relationship instance. |
|
addConstraints ( ) : void |
Set the base constraints on the relation query. |
|
addEagerConstraints ( array $models ) : void |
Set the constraints for an eager load of the relation. |
|
associate ( Model $model ) : Model |
Associate the model instance to the given parent. |
|
getForeignKey ( ) : string |
Get the foreign key of the relationship. |
|
getResults ( ) : mixed |
Get the results of the relationship. |
|
initRelation ( array $models, string $relation ) : void |
Initialize the relation on a set of models. |
|
match ( array $models, Collection $results, string $relation ) : array |
Match the eagerly loaded results to their parents. |
|
update ( array $attributes ) : mixed |
Update the parent model on the relationship. |
|