\app\common\traits\modelOptimLock

Summary

Methods
Properties
Constants
newInstance()
No public properties found
No constants found
getOptimLockField()
checkBeforeSave()
cacheLockVersion()
checkLockVersion()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

newInstance()

newInstance(array  $data = array(), boolean  $isUpdate = false, mixed  $where = null) : \think\Model

创建新的模型实例

Parameters

array $data

数据

boolean $isUpdate

是否为更新

mixed $where

更新条件

Returns

\think\Model

getOptimLockField()

getOptimLockField() 

checkBeforeSave()

checkBeforeSave(array  $data, array  $where) : boolean

写入之前检查数据

Parameters

array $data

数据

array $where

保存条件

Returns

boolean

cacheLockVersion()

cacheLockVersion(array  $data) : void

缓存乐观锁

Parameters

array $data

数据

checkLockVersion()

checkLockVersion() : boolean

检查乐观锁

Returns

boolean