DeferredBinding

 trait Winter\Storm\Database\Traits\DeferredBinding

Properties

public $sessionKey : string

A unique session key used for deferred binding.

Methods

public bindDeferred (string $relation, Illuminate\Database\Eloquent\Model $record, string $sessionKey, array $pivotData = []) : Winter\Storm\Database\Models\DeferredBinding

Bind a deferred relationship to the supplied record.

Parameters
Property Description
$relation
string
$record
Illuminate\Database\Eloquent\Model
$sessionKey
string
$pivotData
array
Returns
Winter\Storm\Database\Models\DeferredBinding

public cancelDeferred (string $sessionKey) : void

Cancel all deferred bindings to this model.

Parameters
Property Description
$sessionKey
string
Returns
void

public commitDeferred (string $sessionKey) : void

Commit all deferred bindings to this model.

Parameters
Property Description
$sessionKey
string
Returns
void

public isDeferrable (string $relationName) : bool

Returns true if a relation exists and can be deferred.

Parameters
Property Description
$relationName
string
Returns
bool

public unbindDeferred (string $relation, Illuminate\Database\Eloquent\Model $record, string $sessionKey) : Winter\Storm\Database\Models\DeferredBinding

Unbind a deferred relationship to the supplied record.

Parameters
Property Description
$relation
string
$record
Illuminate\Database\Eloquent\Model
$sessionKey
string
Returns
Winter\Storm\Database\Models\DeferredBinding

protected commitDeferredAfter (string $sessionKey) : void

Internally used method to commit all deferred bindings after saving.

Parameters
Property Description
$sessionKey
string
Returns
void

protected commitDeferredBefore (string $sessionKey) : void

Internally used method to commit all deferred bindings before saving.

It is a rare need to have to call this, since it only applies to the "belongs to" relationship which generally does not need deferring.

Parameters
Property Description
$sessionKey
string
Returns
void

protected commitDeferredOfType (string $sessionKey, $include = null, $exclude = null) : void

Internal method for committing deferred relations.

Parameters
Property Description
$sessionKey
string
$include
mixed
$exclude
mixed
Returns
void

protected getDeferrableRelationTypes () : array

Returns all possible relation types that can be deferred.

Returns
array

protected getDeferredBindingRecords (string $sessionKey) : Winter\Storm\Database\Collection

Returns any outstanding binding records for this model.

Parameters
Property Description
$sessionKey
string
Returns
Winter\Storm\Database\Collection

Used by

Class Description
File

File attachment model

Parameter

Parameters model Used for storing internal application parameters.

Revision

Revision history model

User

Administrator user model

UserGroup

Administrator group

UserPreference

All preferences for the backend user

UserRole

Administrator role

UserThrottle

Administrator throttling model

Group

Group model

Preferences

User Preferences model

Role

Role model

Throttle

Throttle model

User

User model

File

File attachment model

Model

Active Record base class.

DeferredBinding

Deferred Binding Model

Revision

Revision Model

MorphPivot

Reimplementation of \Illuminate\Database\Eloquent\Relations\MorphPivot but extends Winter's Pivot base class instead of Laravel's to get access to Winter magic.

Pivot
Copyright © 2024 Winter CMS