PHP Class yii\debug\panels\DbPanel

Since: 2.0
Author: Qiang Xue ([email protected])
Inheritance: extends yii\debug\Panel
Afficher le fichier Open project: yiisoft/yii2-debug Class Usage Examples

Méthodes publiques

Свойство Type Description
$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 ]

Méthodes publiques

Méthode Description
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 ( )

Méthodes protégées

Méthode Description
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

Method Details

calculateTimings() public méthode

Calculates given request profile timings.
public calculateTimings ( ) : array
Résultat array timings [token, category, timestamp, traces, nesting level, elapsed time]

canBeExplained() public static méthode

Check if given query type can be explained.
Since: 2.0.5
public static canBeExplained ( string $type ) : boolean
$type string query type
Résultat boolean

getDb() public méthode

Returns a reference to the DB component associated with the panel
Since: 2.0.5
public getDb ( ) : Connection
Résultat yii\db\Connection

getDetail() public méthode

public getDetail ( )

getModels() protected méthode

Can be used with data providers such as \yii\data\ArrayDataProvider.
protected getModels ( ) : array
Résultat array models

getName() public méthode

public getName ( )

getProfileLogs() public méthode

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
Résultat array

getQueryType() protected méthode

Returns database query type.
protected getQueryType ( string $timing ) : string
$timing string timing procedure string
Résultat string query type such as select, insert, delete, etc.

getSummary() public méthode

public getSummary ( )

getSummaryName() public méthode

public getSummaryName ( ) : string
Résultat string short name of the panel, which will be use in summary.

getTotalQueryTime() protected méthode

Returns total query time.
protected getTotalQueryTime ( array $timings ) : integer
$timings array
Résultat integer total time

getTypes() public méthode

Returns array query types
Since: 2.0.3
public getTypes ( ) : array
Résultat array

hasExplain() protected méthode

Since: 2.0.5
protected hasExplain ( ) : boolean
Résultat boolean Whether the DB component has support for EXPLAIN queries

init() public méthode

public init ( )

isQueryCountCritical() public méthode

Check if given queries count is critical according settings.
public isQueryCountCritical ( integer $count ) : boolean
$count integer queries count
Résultat boolean

save() public méthode

public save ( )

Property Details

$criticalQueryThreshold public_oe property

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 public_oe property

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

$defaultFilter public_oe property

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

$defaultOrder public_oe property

the default ordering of the database queries. In the format of [ property => sort direction ], for example: [ 'duration' => SORT_DESC ]
Since: 2.0.7
public $defaultOrder