MorphTo
 class Winter\Storm\Database\Relations\MorphTo
extends Illuminate\Database\Eloquent\Relations\MorphToExtends
| Class | Description | 
|---|---|
| Illuminate\Database\Eloquent\Relations\MorphTo | 
Traits
| Trait | Description | 
|---|---|
| BelongsOrMorphsTo | |
| DeferOneOrMany | |
| DefinedConstraints | 
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 | Type | Description | 
|---|---|---|
| $query | Illuminate\Database\Eloquent\Builder | Illuminate\Database\Eloquent\Builder | 
| $parent | Illuminate\Database\Eloquent\Model | Illuminate\Database\Eloquent\Model | 
| $foreignKey | mixed | mixed | 
| $otherKey | mixed | mixed | 
| $type | mixed | mixed | 
| $relationName | mixed | 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 | Type | Description | 
|---|---|---|
| $value | mixed | 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 | Type | Description | 
|---|---|---|
| $query | Illuminate\Database\Eloquent\Relations\Relation | Winter\Storm\Database\QueryBuilder | Illuminate\Database\Eloquent\Relations\Relation | Winter\Storm\Database\QueryBuilder | 
| $args | array | null | 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 | Type | Description | 
|---|---|---|
| $relation | Illuminate\Database\Eloquent\Relations\Relation | Illuminate\Database\Eloquent\Relations\Relation | 
| $args | array | null | 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 | Type | Description | 
|---|---|---|
| $model | Illuminate\Database\Eloquent\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 | Type | Description | 
|---|---|---|
| $sessionKey | mixed | 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
                
            
            ← Previous page
            Winter\Storm\Database\Relations\MorphOne
        
                
            Next page →
            Winter\Storm\Database\Relations\MorphToMany
        
    
    Copyright © 2025 Winter CMS