\Imi\Db\StatementStatementManager

Summary

Methods
Properties
Constants
set()
setNX()
get()
unUsing()
unUsingAll()
select()
remove()
clear()
getAll()
clearAll()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$statements
N/A

Properties

$statements

$statements : array

statement 缓存数据

Type

array

Methods

set()

set(\Imi\Db\Interfaces\IStatement  $statement, boolean  $using) : void

设置statement缓存

Parameters

\Imi\Db\Interfaces\IStatement $statement
boolean $using

setNX()

setNX(\Imi\Db\Interfaces\IStatement  $statement, boolean  $using) : boolean

设置statement缓存,存在则不设置

Parameters

\Imi\Db\Interfaces\IStatement $statement
boolean $using

Returns

boolean

get()

get(\Imi\Db\Interfaces\IDb  $db, string  $sql) : array|null|boolean

获取连接中对应sql的statement

返回数组则代表获取成功 返回 null 代表没有缓存 返回 false 代表当前缓存不可用

Parameters

\Imi\Db\Interfaces\IDb $db
string $sql

Returns

array|null|boolean

unUsing()

unUsing(\Imi\Db\Interfaces\IStatement  $statement) : void

将连接中对应sql的statement设为可用

Parameters

\Imi\Db\Interfaces\IStatement $statement

unUsingAll()

unUsingAll(\Imi\Db\Interfaces\IDb  $db) : void

将连接中所有statement设为可用

Parameters

\Imi\Db\Interfaces\IDb $db

select()

select(\Imi\Db\Interfaces\IDb  $db) : array

查询连接中有哪些sql缓存statement

Parameters

\Imi\Db\Interfaces\IDb $db

Returns

array

remove()

remove(\Imi\Db\Interfaces\IStatement  $statement) : void

移除连接中对应sql的statement

Parameters

\Imi\Db\Interfaces\IStatement $statement

clear()

clear(\Imi\Db\Interfaces\IDb  $db) : void

清空连接中所有statement

Parameters

\Imi\Db\Interfaces\IDb $db

getAll()

getAll() : array

获取所有连接及对应缓存

Returns

array

clearAll()

clearAll() : void

清空所有连接及对应缓存