BelongsTo
class BelongsTo extends BelongsTo
Adapted from october\rain\database\relations\BelongsTo
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.
Set the defined constraints on the relation query.
Add relation based constraints.
No description
Adds a model to this relationship type.
Removes a model from this relationship type.
Helper for setting this relationship using various expected values. For example, $model->relation = $value;
Helper for getting this relationship simple value, generally useful with form values.
Get the associated 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.
in
DefinedConstraints at line 20
void
addDefinedConstraints()
Set the defined constraints on the relation query.
in
DefinedConstraints at line 35
addDefinedConstraintsToRelation(Relation $relation, array $args = null)
Add relation based constraints.
in
DefinedConstraints at line 85
addDefinedConstraintsToQuery(Builder $query, array $args = null)
Add query based constraints.
at line 22
__construct(Builder $query, Model $child, $foreignKey, $ownerKey, $relationName)
No description
at line 34
add(Model $model, $sessionKey = null)
Adds a model to this relationship type.
at line 47
remove(Model $model, $sessionKey = null)
Removes a model from this relationship type.
at line 61
setSimpleValue($value)
Helper for setting this relationship using various expected values. For example, $model->relation = $value;
at line 93
getSimpleValue()
Helper for getting this relationship simple value, generally useful with form values.
at line 102
string
getOtherKey()
Get the associated key of the relationship.