PHP Класс yii\debug\panels\DbPanel

С версии: 2.0
Автор: Qiang Xue ([email protected])
Наследование: extends yii\debug\Panel
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$criticalQueryThreshold the threshold for determining whether the request has involved critical number of DB queries. If the number of queries exceeds this number, the execution is considered taking critical number of DB queries.
$db the name of the database component to use for executing (explain) queries
$defaultFilter the default filter to apply to the database queries. In the format of [ property => value ], for example: [ 'type' => 'SELECT' ]
$defaultOrder the default ordering of the database queries. In the format of [ property => sort direction ], for example: [ 'duration' => SORT_DESC ]

Открытые методы

Метод Описание
calculateTimings ( ) : array Calculates given request profile timings.
canBeExplained ( string $type ) : boolean Check if given query type can be explained.
getDb ( ) : Connection Returns a reference to the DB component associated with the panel
getDetail ( )
getName ( )
getProfileLogs ( ) : array Returns all profile logs of the current request for this panel. It includes categories such as: 'yii\db\Command::query', 'yii\db\Command::execute'.
getSummary ( )
getSummaryName ( ) : string
getTypes ( ) : array Returns array query types
init ( )
isQueryCountCritical ( integer $count ) : boolean Check if given queries count is critical according settings.
save ( )

Защищенные методы

Метод Описание
getModels ( ) : array Returns an array of models that represents logs of the current request.
getQueryType ( string $timing ) : string Returns database query type.
getTotalQueryTime ( array $timings ) : integer Returns total query time.
hasExplain ( ) : boolean

Описание методов

calculateTimings() публичный Метод

Calculates given request profile timings.
public calculateTimings ( ) : array
Результат array timings [token, category, timestamp, traces, nesting level, elapsed time]

canBeExplained() публичный статический Метод

Check if given query type can be explained.
С версии: 2.0.5
public static canBeExplained ( string $type ) : boolean
$type string query type
Результат boolean

getDb() публичный Метод

Returns a reference to the DB component associated with the panel
С версии: 2.0.5
public getDb ( ) : Connection
Результат yii\db\Connection

getDetail() публичный Метод

public getDetail ( )

getModels() защищенный Метод

Can be used with data providers such as \yii\data\ArrayDataProvider.
protected getModels ( ) : array
Результат array models

getName() публичный Метод

public getName ( )

getProfileLogs() публичный Метод

Returns all profile logs of the current request for this panel. It includes categories such as: 'yii\db\Command::query', 'yii\db\Command::execute'.
public getProfileLogs ( ) : array
Результат array

getQueryType() защищенный Метод

Returns database query type.
protected getQueryType ( string $timing ) : string
$timing string timing procedure string
Результат string query type such as select, insert, delete, etc.

getSummary() публичный Метод

public getSummary ( )

getSummaryName() публичный Метод

public getSummaryName ( ) : string
Результат string short name of the panel, which will be use in summary.

getTotalQueryTime() защищенный Метод

Returns total query time.
protected getTotalQueryTime ( array $timings ) : integer
$timings array
Результат integer total time

getTypes() публичный Метод

Returns array query types
С версии: 2.0.3
public getTypes ( ) : array
Результат array

hasExplain() защищенный Метод

С версии: 2.0.5
protected hasExplain ( ) : boolean
Результат boolean Whether the DB component has support for EXPLAIN queries

init() публичный Метод

public init ( )

isQueryCountCritical() публичный Метод

Check if given queries count is critical according settings.
public isQueryCountCritical ( integer $count ) : boolean
$count integer queries count
Результат boolean

save() публичный Метод

public save ( )

Описание свойств

$criticalQueryThreshold публичное свойство

the threshold for determining whether the request has involved critical number of DB queries. If the number of queries exceeds this number, the execution is considered taking critical number of DB queries.
public $criticalQueryThreshold

$db публичное свойство

the name of the database component to use for executing (explain) queries
public $db

$defaultFilter публичное свойство

the default filter to apply to the database queries. In the format of [ property => value ], for example: [ 'type' => 'SELECT' ]
С версии: 2.0.7
public $defaultFilter

$defaultOrder публичное свойство

the default ordering of the database queries. In the format of [ property => sort direction ], for example: [ 'duration' => SORT_DESC ]
С версии: 2.0.7
public $defaultOrder