Property | Type | Description | |
---|---|---|---|
$localKey | string | The local key on the relationship. | |
$models | List of intermediate model instances. |
Method | Description | |
---|---|---|
__construct ( |
Create a new instance of relation. | |
addConstraints ( ) | Set the base constraints on the relation query. | |
addEagerConstraints ( array $models ) | Set the constraints for an eager load of the relation. | |
getQuery ( ) : |
Get the underlying query for the relation. | |
getRelationQuery ( |
Add the constraints for a relationship query. | |
getResults ( ) : |
Get the results of the relationship. | |
hasSoftDeletes ( |
Determine whether the model uses Soft Deletes. | |
initRelation ( array $models, string $relation ) : array | Initialize the relation on a set of models. | |
match ( array $models, Illuminate\Database\Eloquent\Collection $results, string $relation ) : array | Match the eagerly loaded results to their parents. |
Method | Description | |
---|---|---|
buildDictionary ( Illuminate\Database\Eloquent\Collection $results ) : array | Build model dictionary keyed by the relation's foreign key. | |
getForeignKey ( |
Get foreign key column name for the model. | |
setJoins ( ) | Set the required joins on the relation query. | |
setRelationQueryConstraints ( |
||
setSoftDeletes ( ) | Set the soft deleting constraints on the relation query. |
public __construct ( |
||
$query | ||
$parent | ||
$models | array | |
$localKey | string | null | |
$prefix | string | |
$foreignKeyLookup | array |
public addConstraints ( ) |
public addEagerConstraints ( array $models ) | ||
$models | array |
protected buildDictionary ( Illuminate\Database\Eloquent\Collection $results ) : array | ||
$results | Illuminate\Database\Eloquent\Collection | |
return | array |
protected getForeignKey ( |
||
$model | ||
return | string |
public getQuery ( ) : |
||
return |
public getRelationQuery ( |
||
$query | ||
$parent | ||
$columns | array | mixed | |
return |
public getResults ( ) : |
||
return |
public hasSoftDeletes ( |
||
$model | ||
return | boolean |
protected setRelationQueryConstraints ( |
||
$query |
protected setSoftDeletes ( ) |
protected string $localKey | ||
return | string |