\app\system\modelSystemPlugins

插件模型

Summary

Methods
Properties
Constants
__construct()
getName()
readMaster()
newInstance()
setQuery()
db()
force()
isForce()
replace()
exists()
isExists()
save()
setInc()
setDec()
saveAll()
isUpdate()
delete()
auto()
create()
update()
destroy()
getError()
__wakeup()
__debugInfo()
__set()
__get()
__isset()
__unset()
offsetSet()
offsetExists()
offsetUnset()
offsetGet()
useGlobalScope()
__call()
__callStatic()
getPk()
getKey()
allowField()
readonly()
data()
appendData()
getOrigin()
getData()
getChangedData()
setAttr()
isAutoWriteTimestamp()
getAttr()
withAttribute()
setParent()
getParent()
getRelation()
setRelation()
together()
has()
hasWhere()
relationQuery()
eagerlyResultSet()
eagerlyResult()
relationCount()
hasOne()
belongsTo()
hasMany()
hasManyThrough()
belongsToMany()
morphOne()
morphMany()
morphTo()
event()
flushEvent()
observe()
withEvent()
append()
appendRelationAttr()
hidden()
visible()
toArray()
toJson()
removeRelation()
__toString()
jsonSerialize()
toCollection()
setConfigAttr()
getConfig()
design()
mkConfig()
mkExample()
mkDir()
mkSql()
mkHook()
mkMenu()
mkInfo()
withAttr()
No public properties found
No constants found
buildQuery()
initialize()
init()
autoCompleteData()
checkBeforeSave()
checkAllowFields()
updateData()
insertData()
getWhere()
isPk()
autoWriteTimestamp()
writeTransform()
getRelationAttribute()
readTransform()
parseModel()
getForeignKey()
isRelationAttr()
getRelationData()
checkAutoRelationWrite()
autoRelationUpdate()
autoRelationInsert()
autoRelationDelete()
trigger()
beforeInsert()
afterInsert()
beforeUpdate()
afterUpdate()
beforeWrite()
afterWrite()
beforeDelete()
afterDelete()
beforeRestore()
afterRestore()
formatDateTime()
checkTimeStampWrite()
parseAttr()
$connection
$query
$name
$table
$auto
$insert
$update
$initialized
$readMaster
$queryInstance
$error
$defaultSoftDelete
$globalScope
$pk
$field
$json
$jsonAssoc
$jsonType
$disuse
$readonly
$type
$relationWrite
$observe
$observerClass
$autoWriteTimestamp
$createTime
$updateTime
$dateFormat
$visible
$hidden
$append
$resultSetType
N/A
No private methods found
$exists
$replace
$force
$updateWhere
$data
$set
$origin
$withAttr
$parent
$relation
$together
$event
$withEvent
N/A

Properties

$connection

$connection : array|string

数据库配置信息

Type

array|string

$query

$query : string

数据库查询对象类名

Type

string

$name

$name : string

模型名称

Type

string

$table

$table : string

数据表名称

Type

string

$auto

$auto : array

写入自动完成定义

Type

array

$insert

$insert : array

新增自动完成定义

Type

array

$update

$update : array

更新自动完成定义

Type

array

$initialized

$initialized : array

初始化过的模型.

Type

array

$readMaster

$readMaster : array

是否从主库读取(主从分布式有效)

Type

array

$queryInstance

$queryInstance : \think\db\Query

查询对象实例

Type

\think\db\Query

$error

$error : mixed

错误信息

Type

mixed

$defaultSoftDelete

$defaultSoftDelete : mixed

软删除字段默认值

Type

mixed

$globalScope

$globalScope : array

全局查询范围

Type

array

$pk

$pk : string|array

数据表主键 复合主键使用数组定义

Type

string|array

$field

$field : array

数据表字段信息 留空则自动获取

Type

array

$json

$json : array

JSON数据表字段

Type

array

$jsonAssoc

$jsonAssoc : boolean

JSON数据取出是否需要转换为数组

Type

boolean

$jsonType

$jsonType : array

JSON数据表字段类型

Type

array

$disuse

$disuse : array

数据表废弃字段

Type

array

$readonly

$readonly : array

数据表只读字段

Type

array

$type

$type : array

数据表字段类型

Type

array

$relationWrite

$relationWrite : array

关联自动写入信息

Type

array

$observe

$observe : array

模型事件观察

Type

array

$observerClass

$observerClass : array

绑定模型事件观察者类

Type

array

$autoWriteTimestamp

$autoWriteTimestamp : 

Type

$createTime

$createTime : 

Type

$updateTime

$updateTime : 

Type

$dateFormat

$dateFormat : string

时间字段显示格式

Type

string

$visible

$visible : array

数据输出显示的属性

Type

array

$hidden

$hidden : array

数据输出隐藏的属性

Type

array

$append

$append : array

数据输出需要追加的属性

Type

array

$resultSetType

$resultSetType : string

数据集对象名

Type

string

$exists

$exists : boolean

是否存在数据

Type

boolean

$replace

$replace : boolean

是否Replace

Type

boolean

$force

$force : boolean

是否强制更新所有数据

Type

boolean

$updateWhere

$updateWhere : array

更新条件

Type

array

$data

$data : array

当前模型数据

Type

array

$set

$set : array

修改器执行记录

Type

array

$origin

$origin : array

原始数据

Type

array

$withAttr

$withAttr : array

动态获取器

Type

array

$parent

$parent : object

父关联模型对象

Type

object

$relation

$relation : array

模型关联数据

Type

array

$together

$together : array

关联写入定义信息

Type

array

$event

$event : array

模型回调

Type

array

$withEvent

$withEvent : boolean

是否需要事件响应

Type

boolean

Methods

__construct()

__construct(array|object  $data = array()) 

架构函数

Parameters

array|object $data

数据

getName()

getName() : string

获取当前模型名称

Returns

string

readMaster()

readMaster(boolean  $all = false) : $this

是否从主库读取数据(主从分布有效)

Parameters

boolean $all

是否所有模型有效

Returns

$this

newInstance()

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

创建新的模型实例

Parameters

array|object $data

数据

boolean $isUpdate

是否为更新

mixed $where

更新条件

Returns

\think\Model

setQuery()

setQuery(\think\db\Query  $query) : $this

获取当前模型的数据库查询对象

Parameters

\think\db\Query $query

查询对象实例

Returns

$this

db()

db(boolean|array  $useBaseQuery = true) : \think\db\Query

获取当前模型的数据库查询对象

Parameters

boolean|array $useBaseQuery

是否调用全局查询范围(或者指定查询范围名称)

Returns

\think\db\Query

force()

force(boolean  $force = true) : $this

更新是否强制写入数据 而不做比较

Parameters

boolean $force

Returns

$this

isForce()

isForce() : boolean

判断force

Returns

boolean

replace()

replace(boolean  $replace = true) : $this

新增数据是否使用Replace

Parameters

boolean $replace

Returns

$this

exists()

exists(boolean  $exists) : $this

设置数据是否存在

Parameters

boolean $exists

Returns

$this

isExists()

isExists() : boolean

判断数据是否存在数据库

Returns

boolean

save()

save(array  $data = array(), array  $where = array(), string  $sequence = null) : boolean

保存当前数据对象

Parameters

array $data

数据

array $where

更新条件

string $sequence

自增序列名

Returns

boolean

setInc()

setInc(string  $field, integer  $step = 1, integer  $lazyTime) : boolean

字段值(延迟)增长

Parameters

string $field

字段名

integer $step

增长值

integer $lazyTime

延时时间(s)

Throws

\think\Exception

Returns

boolean

setDec()

setDec(string  $field, integer  $step = 1, integer  $lazyTime) : boolean

字段值(延迟)减少

Parameters

string $field

字段名

integer $step

减少值

integer $lazyTime

延时时间(s)

Throws

\think\Exception

Returns

boolean

saveAll()

saveAll(array  $dataSet, boolean  $replace = true) : \think\Collection

保存多个数据到当前数据对象

Parameters

array $dataSet

数据

boolean $replace

是否自动识别更新和写入

Throws

\Exception

Returns

\think\Collection

isUpdate()

isUpdate(mixed  $update = true, mixed  $where = null) : $this

是否为更新数据

Parameters

mixed $update
mixed $where

Returns

$this

delete()

delete() : boolean

删除当前的记录

Returns

boolean

auto()

auto(array  $fields) : $this

设置自动完成的字段( 规则通过修改器定义)

Parameters

array $fields

需要自动完成的字段

Returns

$this

create()

create(array  $data = array(), array|true  $field = null, boolean  $replace = false) : static

写入数据

Parameters

array $data

数据数组

array|true $field

允许字段

boolean $replace

使用Replace

Returns

static

update()

update(array  $data = array(), array  $where = array(), array|true  $field = null) : static

更新数据

Parameters

array $data

数据数组

array $where

更新条件

array|true $field

允许字段

Returns

static

destroy()

destroy(mixed  $data) : boolean

删除记录

Parameters

mixed $data

主键列表 支持闭包查询条件

Returns

boolean

getError()

getError() : mixed

获取错误信息

Returns

mixed

__wakeup()

__wakeup() 

解序列化后处理

__debugInfo()

__debugInfo() 

__set()

__set(string  $name, mixed  $value) : void

修改器 设置数据对象的值

Parameters

string $name

名称

mixed $value

__get()

__get(string  $name) : mixed

获取器 获取数据对象的值

Parameters

string $name

名称

Returns

mixed

__isset()

__isset(string  $name) : boolean

检测数据对象的值

Parameters

string $name

名称

Returns

boolean

__unset()

__unset(string  $name) : void

销毁数据对象的值

Parameters

string $name

名称

offsetSet()

offsetSet(  $name,   $value) 

Parameters

$name
$value

offsetExists()

offsetExists(  $name) 

Parameters

$name

offsetUnset()

offsetUnset(  $name) 

Parameters

$name

offsetGet()

offsetGet(  $name) 

Parameters

$name

useGlobalScope()

useGlobalScope(boolean|array  $use) : \think\db\Query

设置是否使用全局查询范围

Parameters

boolean|array $use

是否启用全局查询范围(或者用数组指定查询范围名称)

Returns

\think\db\Query

__call()

__call(  $method,   $args) 

Parameters

$method
$args

__callStatic()

__callStatic(  $method,   $args) 

Parameters

$method
$args

getPk()

getPk() : string|array

获取模型对象的主键

Returns

string|array

getKey()

getKey() : integer

获取模型对象的主键值

Returns

integer

allowField()

allowField(array|string|true  $field) : $this

设置允许写入的字段

Parameters

array|string|true $field

允许写入的字段 如果为true只允许写入数据表字段

Returns

$this

readonly()

readonly(array|string  $field) : $this

设置只读字段

Parameters

array|string $field

只读字段

Returns

$this

data()

data(mixed  $data, mixed  $value = null) : $this

设置数据对象值

Parameters

mixed $data

数据或者属性名

mixed $value

Returns

$this

appendData()

appendData(mixed  $data, boolean  $set = false) : $this

批量设置数据对象值

Parameters

mixed $data

数据

boolean $set

是否需要进行数据处理

Returns

$this

getOrigin()

getOrigin(string  $name = null) : mixed

获取对象原始数据 如果不存在指定字段返回null

Parameters

string $name

字段名 留空获取全部

Returns

mixed

getData()

getData(string  $name = null) : mixed

获取对象原始数据 如果不存在指定字段返回false

Parameters

string $name

字段名 留空获取全部

Throws

\InvalidArgumentException

Returns

mixed

getChangedData()

getChangedData() : array

获取变化的数据 并排除只读数据

Returns

array

setAttr()

setAttr(string  $name, mixed  $value, array  $data = array()) : void

修改器 设置数据对象值

Parameters

string $name

属性名

mixed $value

属性值

array $data

数据

isAutoWriteTimestamp()

isAutoWriteTimestamp(boolean  $auto) : $this

是否需要自动写入时间字段

Parameters

boolean $auto

Returns

$this

getAttr()

getAttr(string  $name, array  $item = null) : mixed

获取器 获取数据对象的值

Parameters

string $name

名称

array $item

数据

Throws

\InvalidArgumentException

Returns

mixed

withAttribute()

withAttribute(string|array  $name, callable  $callback = null) : $this

设置数据字段获取器

Parameters

string|array $name

字段名

callable $callback

闭包获取器

Returns

$this

setParent()

setParent(\think\Model  $model) : $this

设置父关联对象

Parameters

\think\Model $model

模型对象

Returns

$this

getParent()

getParent() : \think\Model

获取父关联对象

Returns

\think\Model

getRelation()

getRelation(string  $name = null) : mixed

获取当前模型的关联模型数据

Parameters

string $name

关联方法名

Returns

mixed

setRelation()

setRelation(string  $name, mixed  $value, array  $data = array()) : $this

设置关联数据对象值

Parameters

string $name

属性名

mixed $value

属性值

array $data

数据

Returns

$this

together()

together(array|string  $relation) : $this

关联数据写入

Parameters

array|string $relation

关联

Returns

$this

has()

has(string  $relation, mixed  $operator = '>=', integer  $count = 1, string  $id = '*', string  $joinType = 'INNER') : \think\db\Query

根据关联条件查询当前模型

Parameters

string $relation

关联方法名

mixed $operator

比较操作符

integer $count

个数

string $id

关联表的统计字段

string $joinType

JOIN类型

Returns

\think\db\Query

hasWhere()

hasWhere(string  $relation, mixed  $where = array(), mixed  $fields = '*') : \think\db\Query

根据关联条件查询当前模型

Parameters

string $relation

关联方法名

mixed $where

查询条件(数组或者闭包)

mixed $fields

字段

Returns

\think\db\Query

relationQuery()

relationQuery(string|array  $relations, array  $withRelationAttr = array()) : $this

查询当前模型的关联数据

Parameters

string|array $relations

关联名

array $withRelationAttr

关联获取器

Returns

$this

eagerlyResultSet()

eagerlyResultSet(array  $resultSet, string  $relation, array  $withRelationAttr = array(), boolean  $join = false) : array

预载入关联查询 返回数据集

Parameters

array $resultSet

数据集

string $relation

关联名

array $withRelationAttr

关联获取器

boolean $join

是否为JOIN方式

Returns

array

eagerlyResult()

eagerlyResult(\think\Model  $result, string  $relation, array  $withRelationAttr = array(), boolean  $join = false) : \think\Model

预载入关联查询 返回模型对象

Parameters

\think\Model $result

数据对象

string $relation

关联名

array $withRelationAttr

关联获取器

boolean $join

是否为JOIN方式

Returns

\think\Model

relationCount()

relationCount(\think\Model  $result, array  $relations, string  $aggregate = 'sum', string  $field = '*') : void

关联统计

Parameters

\think\Model $result

数据对象

array $relations

关联名

string $aggregate

聚合查询方法

string $field

字段

hasOne()

hasOne(string  $model, string  $foreignKey = '', string  $localKey = '') : \think\model\relation\HasOne

HAS ONE 关联定义

Parameters

string $model

模型名

string $foreignKey

关联外键

string $localKey

当前主键

Returns

\think\model\relation\HasOne

belongsTo()

belongsTo(string  $model, string  $foreignKey = '', string  $localKey = '') : \think\model\relation\BelongsTo

BELONGS TO 关联定义

Parameters

string $model

模型名

string $foreignKey

关联外键

string $localKey

关联主键

Returns

\think\model\relation\BelongsTo

hasMany()

hasMany(string  $model, string  $foreignKey = '', string  $localKey = '') : \think\model\relation\HasMany

HAS MANY 关联定义

Parameters

string $model

模型名

string $foreignKey

关联外键

string $localKey

当前主键

Returns

\think\model\relation\HasMany

hasManyThrough()

hasManyThrough(string  $model, string  $through, string  $foreignKey = '', string  $throughKey = '', string  $localKey = '') : \think\model\relation\HasManyThrough

HAS MANY 远程关联定义

Parameters

string $model

模型名

string $through

中间模型名

string $foreignKey

关联外键

string $throughKey

关联外键

string $localKey

当前主键

Returns

\think\model\relation\HasManyThrough

belongsToMany()

belongsToMany(string  $model, string  $table = '', string  $foreignKey = '', string  $localKey = '') : \think\model\relation\BelongsToMany

BELONGS TO MANY 关联定义

Parameters

string $model

模型名

string $table

中间表名

string $foreignKey

关联外键

string $localKey

当前模型关联键

Returns

\think\model\relation\BelongsToMany

morphOne()

morphOne(string  $model, string|array  $morph = null, string  $type = '') : \think\model\relation\MorphOne

MORPH One 关联定义

Parameters

string $model

模型名

string|array $morph

多态字段信息

string $type

多态类型

Returns

\think\model\relation\MorphOne

morphMany()

morphMany(string  $model, string|array  $morph = null, string  $type = '') : \think\model\relation\MorphMany

MORPH MANY 关联定义

Parameters

string $model

模型名

string|array $morph

多态字段信息

string $type

多态类型

Returns

\think\model\relation\MorphMany

morphTo()

morphTo(string|array  $morph = null, array  $alias = array()) : \think\model\relation\MorphTo

MORPH TO 关联定义

Parameters

string|array $morph

多态字段信息

array $alias

多态别名定义

Returns

\think\model\relation\MorphTo

event()

event(string  $event, callable  $callback, boolean  $override = false) : void

注册回调方法

Parameters

string $event

事件名

callable $callback

回调方法

boolean $override

是否覆盖

flushEvent()

flushEvent() : void

清除回调方法

observe()

observe(object|string  $class) : void

注册一个模型观察者

Parameters

object|string $class

withEvent()

withEvent(boolean  $event) : $this

当前操作的事件响应

Parameters

boolean $event

是否需要事件响应

Returns

$this

append()

append(array  $append = array(), boolean  $override = false) : $this

设置需要附加的输出属性

Parameters

array $append

属性列表

boolean $override

是否覆盖

Returns

$this

appendRelationAttr()

appendRelationAttr(string  $attr, string|array  $append) : $this

设置附加关联对象的属性

Parameters

string $attr

关联属性

string|array $append

追加属性名

Throws

\think\Exception

Returns

$this

hidden()

hidden(array  $hidden = array(), boolean  $override = false) : $this

设置需要隐藏的输出属性

Parameters

array $hidden

属性列表

boolean $override

是否覆盖

Returns

$this

visible()

visible(array  $visible = array(), boolean  $override = false) : $this

设置需要输出的属性

Parameters

array $visible
boolean $override

是否覆盖

Returns

$this

toArray()

toArray() : array

转换当前模型对象为数组

Returns

array

toJson()

toJson(integer  $options = JSON_UNESCAPED_UNICODE) : string

转换当前模型对象为JSON字符串

Parameters

integer $options

json参数

Returns

string

removeRelation()

removeRelation() : $this

移除当前模型的关联属性

Returns

$this

__toString()

__toString() 

jsonSerialize()

jsonSerialize() 

toCollection()

toCollection(array|\think\Collection  $collection, string  $resultSetType = null) : \think\Collection

转换数据集为数据集对象

Parameters

array|\think\Collection $collection

数据集

string $resultSetType

数据集类

Returns

\think\Collection

setConfigAttr()

setConfigAttr(  $value) 

Parameters

$value

getConfig()

getConfig(string  $name = '', boolean  $update = false) : mixed

获取插件配置信息

Parameters

string $name

配置名

boolean $update

是否更新缓存

Returns

mixed

design()

design(  $data = array()) : boolean

设计并生成标准插件结构

Parameters

$data

Returns

boolean

mkConfig()

mkConfig(string  $path = '', string  $config = array()) 

生成插件配置

Parameters

string $path

插件完整路径

string $config

插件配置信息

mkExample()

mkExample(string  $path = '', string  $data = array()) 

生成默认示例控制器

Parameters

string $path

插件完整路径

string $data

插件基本信息

mkDir()

mkDir(string  $path = '', array  $list = array()) 

生成目录结构

Parameters

string $path

插件完整路径

array $list

目录列表

mkSql()

mkSql(string  $path = '') 

生成SQL文件

Parameters

string $path

插件完整路径

mkHook()

mkHook(string  $path = '', string  $data = array()) 

生成钩子文件

Parameters

string $path

插件完整路径

string $data

插件基本信息

mkMenu()

mkMenu(string  $path = '',   $data = array()) 

生成菜单文件

Parameters

string $path

插件完整路径

$data

mkInfo()

mkInfo(string  $path = '', string  $data = array(),   $config = array()) 

生成插件基本信息

Parameters

string $path

插件完整路径

string $data

插件基本信息

$config

withAttr()

withAttr(array  $name, \Closure  $closure) : \think\Model

动态定义获取器

Parameters

array $name
\Closure $closure

Returns

\think\Model

buildQuery()

buildQuery() : \think\db\Query

创建模型的查询对象

Returns

\think\db\Query

initialize()

initialize() : void

初始化模型

init()

init() : void

初始化处理

autoCompleteData()

autoCompleteData(array  $auto = array()) : void

数据自动完成

Parameters

array $auto

要自动更新的字段列表

checkBeforeSave()

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

写入之前检查数据

Parameters

array $data

数据

array $where

保存条件

Returns

boolean

checkAllowFields()

checkAllowFields(array  $append = array()) : array

检查数据是否允许写入

Parameters

array $append

自动完成的字段列表

Returns

array

updateData()

updateData(mixed  $where) : boolean

更新写入数据

Parameters

mixed $where

更新条件

Returns

boolean

insertData()

insertData(string  $sequence) : boolean

新增写入数据

Parameters

string $sequence

自增序列名

Returns

boolean

getWhere()

getWhere() : mixed

获取当前的更新条件

Returns

mixed

isPk()

isPk(string  $key) : boolean

判断一个字段名是否为主键字段

Parameters

string $key

名称

Returns

boolean

autoWriteTimestamp()

autoWriteTimestamp(string  $name) : mixed

自动写入时间戳

Parameters

string $name

时间戳字段

Returns

mixed

writeTransform()

writeTransform(mixed  $value, string|array  $type) : mixed

数据写入 类型转换

Parameters

mixed $value

string|array $type

要转换的类型

Returns

mixed

getRelationAttribute()

getRelationAttribute(string  $name, array  $item) : mixed

获取关联属性值

Parameters

string $name

属性名

array $item

数据

Returns

mixed

readTransform()

readTransform(mixed  $value, string|array  $type) : mixed

数据读取 类型转换

Parameters

mixed $value

string|array $type

要转换的类型

Returns

mixed

parseModel()

parseModel(string  $model) : string

解析模型的完整命名空间

Parameters

string $model

模型名(或者完整类名)

Returns

string

getForeignKey()

getForeignKey(string  $name) : string

获取模型的默认外键名

Parameters

string $name

模型名

Returns

string

isRelationAttr()

isRelationAttr(string  $attr) : string|false

检查属性是否为关联属性 如果是则返回关联方法名

Parameters

string $attr

关联属性名

Returns

string|false

getRelationData()

getRelationData(\think\model\Relation  $modelRelation) : mixed

智能获取关联模型数据

Parameters

\think\model\Relation $modelRelation

模型关联对象

Returns

mixed

checkAutoRelationWrite()

checkAutoRelationWrite() : void

关联数据自动写入检查

autoRelationUpdate()

autoRelationUpdate() : void

自动关联数据更新(针对一对一关联)

autoRelationInsert()

autoRelationInsert() : void

自动关联数据写入(针对一对一关联)

autoRelationDelete()

autoRelationDelete() : void

自动关联数据删除(支持一对一及一对多关联)

trigger()

trigger(string  $event) : boolean

触发事件

Parameters

string $event

事件名

Returns

boolean

beforeInsert()

beforeInsert(callable  $callback, boolean  $override = false) 

模型before_insert事件快捷方法

Parameters

callable $callback
boolean $override

afterInsert()

afterInsert(callable  $callback, boolean  $override = false) 

模型after_insert事件快捷方法

Parameters

callable $callback
boolean $override

beforeUpdate()

beforeUpdate(callable  $callback, boolean  $override = false) 

模型before_update事件快捷方法

Parameters

callable $callback
boolean $override

afterUpdate()

afterUpdate(callable  $callback, boolean  $override = false) 

模型after_update事件快捷方法

Parameters

callable $callback
boolean $override

beforeWrite()

beforeWrite(callable  $callback, boolean  $override = false) 

模型before_write事件快捷方法

Parameters

callable $callback
boolean $override

afterWrite()

afterWrite(callable  $callback, boolean  $override = false) 

模型after_write事件快捷方法

Parameters

callable $callback
boolean $override

beforeDelete()

beforeDelete(callable  $callback, boolean  $override = false) 

模型before_delete事件快捷方法

Parameters

callable $callback
boolean $override

afterDelete()

afterDelete(callable  $callback, boolean  $override = false) 

模型after_delete事件快捷方法

Parameters

callable $callback
boolean $override

beforeRestore()

beforeRestore(callable  $callback, boolean  $override = false) 

模型before_restore事件快捷方法

Parameters

callable $callback
boolean $override

afterRestore()

afterRestore(callable  $callback, boolean  $override = false) 

模型after_restore事件快捷方法

Parameters

callable $callback
boolean $override

formatDateTime()

formatDateTime(mixed  $format, mixed  $time = 'now', boolean  $timestamp = false) : mixed

时间日期字段格式化处理

Parameters

mixed $format

日期格式

mixed $time

时间日期表达式

boolean $timestamp

是否进行时间戳转换

Returns

mixed

checkTimeStampWrite()

checkTimeStampWrite() : void

检查时间字段写入

parseAttr()

parseAttr(array  $attrs, array  $result, boolean  $visible = true) : array

解析隐藏及显示属性

Parameters

array $attrs

属性

array $result

结果集

boolean $visible

Returns

array