HasOneOrMany
trait HasOneOrMany
Adapted from october\rain\database\relations\HasOneOrMany
Traits
Adapted from october\rain\database\relations\DeferOneOrMany
Properties
protected string | $relationName |
Methods
Returns the model query with deferred bindings added
Returns the related "slave id" key in a database friendly format.
Save the supplied related model with deferred binding support.
Alias for the addMany() method.
Create a new instance of this related model with deferred binding support.
Adds a model to this relationship type.
Attach an array of models to the parent instance with deferred binding support.
Removes a model from this relationship type.
Get the foreign key for the relationship.
Get the associated "other" key of the relationship.
Details
in
DeferOneOrMany at line 17
Builder
withDeferred($sessionKey)
Returns the model query with deferred bindings added
in
DeferOneOrMany at line 125
protected Expression
getWithDeferredQualifiedKeyName()
Returns the related "slave id" key in a database friendly format.
at line 22
save(Model $model, $sessionKey = null)
Save the supplied related model with deferred binding support.
at line 38
array
saveMany(array $models, $sessionKey = null)
Alias for the addMany() method.
at line 48
create(array $attributes = [], $sessionKey = null)
Create a new instance of this related model with deferred binding support.
at line 62
add(Model $model, $sessionKey = null)
Adds a model to this relationship type.
at line 91
void
addMany(array $models, $sessionKey = null)
Attach an array of models to the parent instance with deferred binding support.
at line 101
remove(Model $model, $sessionKey = null)
Removes a model from this relationship type.
at line 126
string
getForeignKey()
Get the foreign key for the relationship.
at line 135
string
getOtherKey()
Get the associated "other" key of the relationship.