Class yii\mongodb\debug\MongoDbPanel
Inheritance | yii\mongodb\debug\MongoDbPanel » yii\debug\panels\DbPanel |
---|---|
Available since extension's version | 2.0.1 |
Source Code | https://github.com/yiisoft/yii2-mongodb/blob/master/src/debug/MongoDbPanel.php |
MongoDbPanel panel that collects and displays MongoDB queries performed.
Public Properties
Property | Type | Description | Defined By |
---|---|---|---|
$db | yii\mongodb\debug\MongoDbPanel | ||
$profileLogs | array | This property is read-only. | yii\mongodb\debug\MongoDbPanel |
Public Methods
Method | Description | Defined By |
---|---|---|
canBeExplained() | yii\mongodb\debug\MongoDbPanel | |
getDetail() | yii\mongodb\debug\MongoDbPanel | |
getName() | yii\mongodb\debug\MongoDbPanel | |
getProfileLogs() | Returns all profile logs of the current request for this panel. | yii\mongodb\debug\MongoDbPanel |
getSummaryName() | yii\mongodb\debug\MongoDbPanel | |
init() | yii\mongodb\debug\MongoDbPanel |
Protected Methods
Method | Description | Defined By |
---|---|---|
getQueryType() | yii\mongodb\debug\MongoDbPanel | |
hasExplain() | yii\mongodb\debug\MongoDbPanel |
Property Details
Method Details
public static void canBeExplained ( $type ) | ||
$type |
public static function canBeExplained($type)
{
return $type === 'find';
}
public void getDetail ( ) |
public function getDetail()
{
$searchModel = new Db();
if (!$searchModel->load(Yii::$app->request->getQueryParams())) {
$searchModel->load($this->defaultFilter, '');
}
$dataProvider = $searchModel->search($this->getModels());
$dataProvider->getSort()->defaultOrder = $this->defaultOrder;
return Yii::$app->view->render('@yii/mongodb/debug/views/detail', [
'panel' => $this,
'dataProvider' => $dataProvider,
'searchModel' => $searchModel,
]);
}
Returns all profile logs of the current request for this panel.
public array getProfileLogs ( ) |
public function getProfileLogs()
{
$target = $this->module->logTarget;
return $target->filterMessages($target->messages, Logger::LEVEL_PROFILE, [
'yii\mongodb\Command::*',
'yii\mongodb\Query::*',
'yii\mongodb\BatchQueryResult::*',
]);
}
protected void getQueryType ( $timing ) | ||
$timing |
protected function getQueryType($timing)
{
$timing = ltrim($timing);
$timing = mb_substr($timing, 0, mb_strpos($timing, '('), 'utf8');
$matches = explode('.', $timing);
return count($matches) ? array_pop($matches) : '';
}
public void init ( ) |
public function init()
{
$this->actions['mongodb-explain'] = [
'class' => 'yii\\mongodb\\debug\\ExplainAction',
'panel' => $this,
];
}