trait MorphOneOrMany

Adapted from october\rain\database\relations\MorphOneOrMany

Traits

Adapted from october\rain\database\relations\DeferOneOrMany

Properties

protected string $relationName

Methods

Builder
withDeferred($sessionKey)

Returns the model query with deferred bindings added

Expression
getWithDeferredQualifiedKeyName()

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

save(Model $model, $sessionKey = null)

Save the supplied related model with deferred binding support.

create(array $attributes = [], $sessionKey = null)

Create a new instance of this related model with deferred binding support.

add(Model $model, $sessionKey = null)

Adds a model to this relationship type.

remove(Model $model, $sessionKey = null)

Removes a model from this relationship type.

Details

in DeferOneOrMany at line 17
Builder withDeferred($sessionKey)

Returns the model query with deferred bindings added

Parameters

$sessionKey

Return Value

Builder

in DeferOneOrMany at line 125
protected Expression getWithDeferredQualifiedKeyName()

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

Return Value

Expression

at line 22
save(Model $model, $sessionKey = null)

Save the supplied related model with deferred binding support.

Parameters

Model $model
$sessionKey

at line 36
create(array $attributes = [], $sessionKey = null)

Create a new instance of this related model with deferred binding support.

Parameters

array $attributes
$sessionKey

at line 50
add(Model $model, $sessionKey = null)

Adds a model to this relationship type.

Parameters

Model $model
$sessionKey

at line 75
remove(Model $model, $sessionKey = null)

Removes a model from this relationship type.

Parameters

Model $model
$sessionKey