MorphTo

 class Winter\Storm\Database\Relations\MorphTo
extends Illuminate\Database\Eloquent\Relations\MorphTo

Extends

Traits

Properties

protected $relationName : string

The "name" of the relationship.

Methods

public __construct (Illuminate\Database\Eloquent\Builder $query, Illuminate\Database\Eloquent\Model $parent, $foreignKey, $otherKey, $type, $relationName)

Parameters
Property Description
$query
Illuminate\Database\Eloquent\Builder
$parent
Illuminate\Database\Eloquent\Model
$foreignKey
mixed
$otherKey
mixed
$type
mixed
$relationName
mixed
Returns
mixed

public getSimpleValue ()

Helper for getting this relationship simple value, generally useful with form values.

Returns
mixed

public setSimpleValue ($value)

Helper for setting this relationship using various expected values. For example, $model->relation = $value;

Parameters
Property Description
$value
mixed
Returns
mixed

inherited public addDefinedConstraints () : void

Inherited from DefinedConstraints

Set the defined constraints on the relation query.

Returns
void

inherited public addDefinedConstraintsToQuery (Illuminate\Database\Eloquent\Relations\Relation | Winter\Storm\Database\QueryBuilder $query, array | null $args = null)

Inherited from DefinedConstraints

Add query based constraints.

Parameters
Property Description
$query
Illuminate\Database\Eloquent\Relations\Relation | Winter\Storm\Database\QueryBuilder
$args
array | null
Returns
mixed

inherited public addDefinedConstraintsToRelation (Illuminate\Database\Eloquent\Relations\Relation $relation, array | null $args = null)

Inherited from DefinedConstraints

Add relation based constraints.

Parameters
Property Description
$relation
Illuminate\Database\Eloquent\Relations\Relation
$args
array | null
Returns
mixed

inherited public associate (Illuminate\Database\Eloquent\Model $model) : Illuminate\Database\Eloquent\Model

Inherited from BelongsOrMorphsTo

Associate the model instance to the given parent.

Parameters
Property Description
$model
Illuminate\Database\Eloquent\Model
Returns
Illuminate\Database\Eloquent\Model

inherited public dissociate () : Illuminate\Database\Eloquent\Model

Inherited from BelongsOrMorphsTo

Dissociate previously associated model from the given parent.

Returns
Illuminate\Database\Eloquent\Model

inherited public withDeferred ($sessionKey) : Illuminate\Database\Eloquent\Builder

Inherited from DeferOneOrMany

Returns the model query with deferred bindings added

Parameters
Property Description
$sessionKey
mixed
Returns
Illuminate\Database\Eloquent\Builder

inherited protected getWithDeferredQualifiedKeyName () : Illuminate\Database\Query\Expression

Inherited from DeferOneOrMany

Returns the related "slave id" key in a database friendly format.

Returns
Illuminate\Database\Query\Expression
Copyright © 2024 Winter CMS