\Imi\Db\QueryResult

Summary

Methods
Properties
Constants
__construct()
__destruct()
isSuccess()
getLastInsertId()
getAffectedRows()
get()
getArray()
getColumn()
getScalar()
getRowCount()
getSql()
getStatement()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$statement
$isSuccess
$modelClass
$statementRecords
N/A

Properties

$isSuccess

$isSuccess : boolean

是否执行成功

Type

boolean

$modelClass

$modelClass : string

查询结果类的类名,为null则为数组

Type

string

$statementRecords

$statementRecords : array

记录列表

Type

array

Methods

__construct()

__construct(\Imi\Db\Interfaces\IStatement  $statement, string|null  $modelClass = null) 

Undocumented function

Parameters

\Imi\Db\Interfaces\IStatement $statement
string|null $modelClass

__destruct()

__destruct() 

isSuccess()

isSuccess() : boolean

SQL是否执行成功

Returns

boolean

getLastInsertId()

getLastInsertId() : string

获取最后插入的ID

Returns

string

getAffectedRows()

getAffectedRows() : integer

获取影响行数

Returns

integer

get()

get(string  $className = null) : mixed|null

返回一行数据,数组或对象,失败返回null

Parameters

string $className

实体类名,为null则返回数组

Returns

mixed|null

getArray()

getArray(string  $className = null) : array|null

返回数组,失败返回null

Parameters

string $className

实体类名,为null则数组每个成员为数组

Returns

array|null

getColumn()

getColumn(  $column) : array

获取一列数据

Parameters

$column

Returns

array

getScalar()

getScalar(integer|string  $columnKey) : mixed

获取标量结果

Parameters

integer|string $columnKey

Returns

mixed

getRowCount()

getRowCount() : integer

获取记录行数

Returns

integer

getSql()

getSql() : string

获取执行的SQL语句

Returns

string