CanBeOneOfMany
Properties
$isOneOfMany bool
Determines whether the relationship is one-of-many.
$relationName string
The name of the relationship.
$oneOfManySubQuery Builder |null
The one of many inner join subselect query builder instance.
Methods
addOneOfManySubQueryConstraints ( Builder $query , $column , $aggregate ) : void
Add constraints for inner join subselect for one of many relationships.
Parameters
- $query Builder
- $column string|null
- $aggregate string|null
getOneOfManySubQuerySelectColumns ( ) : array|string
Get the columns the determine the relationship groups.
addOneOfManyJoinSubQueryConstraints ( JoinClause $join ) : void
Add join query constraints for one of many relationships.
Parameters
- $join Illuminate\...\JoinClause
ofMany ( $column , $aggregate , $relation ) : $this
Indicate that the relation is a single result of a larger one-to-many relationship.
Parameters
- $column string|array|null
- $aggregate string|Closure |null
- $relation string|null
latestOfMany ( $column , $relation ) : $this
Indicate that the relation is the latest single result of a larger one-to-many relationship.
Parameters
- $column string|array|null
- $aggregate string|Closure |null
- $relation string|null
oldestOfMany ( $column , $relation ) : $this
Indicate that the relation is the oldest single result of a larger one-to-many relationship.
Parameters
- $column string|array|null
- $aggregate string|Closure |null
- $relation string|null
getDefaultOneOfManyJoinAlias ( $relation ) : string
Get the default alias for the one of many inner join clause.
Parameters
- $relation string
newOneOfManySubQuery ( $groupBy , $column , $aggregate ) : Builder
Get a new query for the related model, grouping the query by the given column, often the foreign key of the relationship.
Parameters
- $groupBy string|array
- $column string|null
- $aggregate string|null
addOneOfManyJoinSubQuery ( Builder $parent , Builder $subQuery , $on ) : void
Add the join subquery to the given query on the given column and the relationship's foreign key.
Parameters
mergeOneOfManyJoinsTo ( Builder $query ) : void
Merge the relationship query joins to the given query builder.
Parameters
- $builder Builder
getRelationQuery ( ) : Builder
Get the query builder that will contain the relationship constraints.
getOneOfManySubQuery ( ) : Builder |void
Get the one of many inner join subselect builder instance.
qualifySubSelectColumn ( $column ) : string
Get the qualified column name for the one-of-many relationship using the subselect join query's alias.
Parameters
- $column string
qualifyRelatedColumn ( $column ) : string
Qualify related column using the related table name if it is not already qualified.
Parameters
- $column string
guessRelationship ( ) : string
Guess the "hasOne" relationship's name via backtrace.
isOneOfMany ( ) : bool
Determine whether the relationship is a one-of-many relationship.
getRelationName ( ) : string
Get the name of the relationship.