Properties

$realClassNames

$realClassNames : array

真实类名集合

Type

array

$__fieldNames

$__fieldNames : array

数据库原始字段名称

Type

array

$__camelCache

$__camelCache : array

驼峰缓存

Type

array

$__methodReference

$__methodReference : array

方法引用

Type

array

$__metas

$__metas : array<mixed,\Imi\Model\Meta>

元数据集合

Type

array<mixed,\Imi\Model\Meta>

$__meta

$__meta : \Imi\Model\Meta

当前对象 meta 缓存

Type

\Imi\Model\Meta

$__realClass

$__realClass : string

真实类名

Type

string

$__key

$__key : string

记录的key值

Type

string

$events

$events : array<mixed,\Imi\Event\EventItem[]>

事件数据映射原始数据

Type

array<mixed,\Imi\Event\EventItem[]>

$eventQueue

$eventQueue : array<mixed,\SplPriorityQueue>

事件队列,按执行顺序排

Type

array<mixed,\SplPriorityQueue>

$eventChangeRecords

$eventChangeRecords : array

事件更改记录

Type

array

Methods

__construct()

__construct(  $data = array()) 

Parameters

$data

__init()

__init(  $data = array()) 

Parameters

$data

newInstance()

newInstance(mixed  ...$args) : static

实例化当前类

Parameters

mixed $args variadic

Returns

static

offsetExists()

offsetExists(  $offset) 

Parameters

$offset

offsetGet()

offsetGet(  $offset) 

Parameters

$offset

offsetSet()

offsetSet(  $offset,   $value) 

Parameters

$offset
$value

offsetUnset()

offsetUnset(  $offset) 

Parameters

$offset

__get()

__get(  $name) 

Parameters

$name

__set()

__set(  $name,   $value) 

Parameters

$name
$value

__isset()

__isset(  $name) 

Parameters

$name

__unset()

__unset(  $name) 

Parameters

$name

toArray()

toArray() : array

将当前对象作为数组返回

Returns

array

current()

current() 

key()

key() 

next()

next() 

rewind()

rewind() 

valid()

valid() 

jsonSerialize()

jsonSerialize() 

set()

set(array  $data) : void

从一个数组赋值到当前模型

Parameters

array $data

__getMeta()

__getMeta(string|object  $object = null) : \Imi\Model\Meta

Get 元数据

Parameters

string|object $object

Returns

\Imi\Model\Meta

on()

on(string|array<mixed,string>  $name, mixed  $callback, integer  $priority) : void

事件监听

Parameters

string|array<mixed,string> $name

事件名称

mixed $callback

回调,支持回调函数、基于IEventListener的类名

integer $priority

优先级,越大越先执行

one()

one(string|array<mixed,string>  $name, mixed  $callback, integer  $priority) : void

监听事件,仅触发一次

Parameters

string|array<mixed,string> $name

事件名称

mixed $callback

回调,支持回调函数、基于IEventListener的类名

integer $priority

优先级,越大越先执行

off()

off(string|array<mixed,string>  $name, mixed|null  $callback = null) : void

取消事件监听

Parameters

string|array<mixed,string> $name

事件名称

mixed|null $callback

回调,支持回调函数、基于IEventListener的类名。为 null 则不限制

trigger()

trigger(string  $name, array  $data = array(), mixed  $target = null, string  $paramClass = \Imi\Event\EventParam::class) : void

触发事件

Parameters

string $name

事件名称

array $data

数据

mixed $target

目标对象

string $paramClass

参数类

find()

find(string  $key) : static

查找一条记录

Parameters

string $key

Returns

static

select()

select() : array<mixed,static>

查询多条记录

Returns

array<mixed,static>

save()

save() : void

保存记录

delete()

delete() : void

删除记录

deleteBatch()

deleteBatch(string  ...$keys) : void

批量删除

Parameters

string $keys variadic

count()

count() : integer

统计数量

Returns

integer

__getKey()

__getKey() : string

获取键

Returns

string

__setKey()

__setKey(string  $key) : static

设置键

Parameters

string $key

Returns

static

__getCamelName()

__getCamelName(string  $name) : string

获取驼峰命名

Parameters

string $name

Returns

string

__getFieldName()

__getFieldName(string  $fieldName) : void

获取字段名

Parameters

string $fieldName

__parseExtractProperty()

__parseExtractProperty(string  $propertyName, array<mixed,\Imi\Model\Annotation\ExtractProperty>  $annotations) : void

处理导出属性

Parameters

string $propertyName
array<mixed,\Imi\Model\Annotation\ExtractProperty> $annotations

__getRealClassName()

__getRealClassName() : string

获取当前Bean类真实类名

Returns

string

rebuildEventQueue()

rebuildEventQueue(  $name) : void

重建事件队列

Parameters

$name