You are viewing an older version of the documentation. For the latest, please visit master documentation.

MorphOne

Extends

Implements

Uses

Methods

public

getResults ( ) : mixed

Get the results of the relationship.

public

initRelation ( array $models , $relation ) : array

Initialize the relation on a set of models.

Parameters

  • $models array
  • $relation string
public

match ( array $models , Collection $results , $relation ) : array

Match the eagerly loaded results to their parents.

Parameters

public

getRelationExistenceQuery ( Builder $query , Builder $parentQuery , $columns ) : Builder

Get the relationship query.

Parameters

public

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
public

getOneOfManySubQuerySelectColumns ( ) : array|string

Get the columns that should be selected by the one of many subquery.

public

addOneOfManyJoinSubQueryConstraints ( JoinClause $join ) : void

Add join query constraints for one of many relationships.

Parameters

  • $join Illuminate\...\JoinClause
public

newRelatedInstanceFor ( Model $parent ) : Model

Make a new related instance for the given model.

Parameters

protected

getRelatedKeyFrom ( Model $model ) : mixed

Get the value of the model's foreign key.

Parameters