trait OptimisticLockingTrait

Optimistic locking trait.

Methods

array
getOptimisticLockingTraitHooks()

Returns trait hooks.

__clone()

Making sure that cloning returns a "fresh copy" of the record.

string
getLockingColumn()

Returns the optimistic locking column.

bool
reload()

Reloads the record from the database.

setLockVersion(int $version)

Sets the optimistic locking version.

int
getLockVersion()

Returns the optimistic locking version.

bool
updateRecord(Query $query)

Updates an existing record.

bool
deleteRecord(Query $query)

Deletes a record from the database.

Details

at line 26
protected array getOptimisticLockingTraitHooks()

Returns trait hooks.

Return Value

array

at line 56
__clone()

Making sure that cloning returns a "fresh copy" of the record.

at line 71
protected string getLockingColumn()

Returns the optimistic locking column.

Return Value

string

at line 81
bool reload()

Reloads the record from the database.

Return Value

bool

at line 105
setLockVersion(int $version)

Sets the optimistic locking version.

Parameters

int $version Locking version

at line 115
int getLockVersion()

Returns the optimistic locking version.

Return Value

int

at line 126
protected bool updateRecord(Query $query)

Updates an existing record.

Parameters

Query $query Query builder

Return Value

bool

at line 152
protected bool deleteRecord(Query $query)

Deletes a record from the database.

Parameters

Query $query Query builder

Return Value

bool