MorphOne
class Winter\Storm\Database\Relations\MorphOne
extends Illuminate\Database\Eloquent\Relations\MorphOne
Extends
Class | Description |
---|---|
Illuminate\Database\Eloquent\Relations\MorphOne
|
Traits
Trait | Description |
---|---|
DefinedConstraints
|
|
MorphOneOrMany
|
Properties
inherited protected $relationName : string
Inherited from
MorphOneOrMany
The "name" of the relationship.
Methods
public
__construct (Illuminate\Database\Eloquent\Builder $query, Illuminate\Database\Eloquent\Model $parent, $type, $id, $localKey, $relationName = null
)
: void
Create a new has many relationship instance.
Parameters
Property | Type | Description |
---|---|---|
$query | Illuminate\Database\Eloquent\Builder |
Illuminate\Database\Eloquent\Builder
|
$parent | Illuminate\Database\Eloquent\Model |
Illuminate\Database\Eloquent\Model
|
$type | mixed |
mixed
|
$id | mixed |
mixed
|
$localKey | mixed |
mixed
|
$relationName | mixed |
mixed
|
Returns
void
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
add (Illuminate\Database\Eloquent\Model $model, $sessionKey = null
)
Inherited from
MorphOneOrMany
Adds a model to this relationship type.
Parameters
Property | Type | Description |
---|---|---|
$model | Illuminate\Database\Eloquent\Model |
Illuminate\Database\Eloquent\Model
|
$sessionKey | 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
create (array $attributes = []
, $sessionKey = null
)
Inherited from
MorphOneOrMany
Create a new instance of this related model with deferred binding support.
Parameters
Property | Type | Description |
---|---|---|
$attributes | array |
array
|
$sessionKey | mixed |
mixed
|
Returns
mixed
inherited
public
remove (Illuminate\Database\Eloquent\Model $model, $sessionKey = null
)
Inherited from
MorphOneOrMany
Removes a model from this relationship type.
Parameters
Property | Type | Description |
---|---|---|
$model | Illuminate\Database\Eloquent\Model |
Illuminate\Database\Eloquent\Model
|
$sessionKey | mixed |
mixed
|
Returns
mixed
inherited
public
save (Illuminate\Database\Eloquent\Model $model, $sessionKey = null
)
Inherited from
MorphOneOrMany
Save the supplied related model with deferred binding support.
Parameters
Property | Type | Description |
---|---|---|
$model | Illuminate\Database\Eloquent\Model |
Illuminate\Database\Eloquent\Model
|
$sessionKey | mixed |
mixed
|
Returns
mixed
← Previous page
Winter\Storm\Database\Relations\MorphMany
Next page →
Winter\Storm\Database\Relations\MorphTo
Copyright © 2024 Winter CMS