Class yii\mongodb\debug\MongoDbPanel

Inheritanceyii\mongodb\debug\MongoDbPanel » yii\debug\panels\DbPanel
Available since extension's version2.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

Hide inherited properties

Property Type Description Defined By
$db yii\mongodb\debug\MongoDbPanel
$profileLogs array This property is read-only. yii\mongodb\debug\MongoDbPanel

Property Details

Hide inherited properties

$db public property
public $db 'mongodb'
$profileLogs public property

This property is read-only.

public array $profileLogs null

Method Details

Hide inherited methods

canBeExplained() public static method

public static void canBeExplained ( $type )
$type

                public static function canBeExplained($type)
{
    return $type === 'find';
}

            
getDetail() public method

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,
    ]);
}

            
getName() public method

public void getName ( )

                public function getName()
{
    return 'MongoDB';
}

            
getProfileLogs() public method

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::*',
    ]);
}

            
getQueryType() protected method

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) : '';
}

            
getSummaryName() public method

public void getSummaryName ( )

                public function getSummaryName()
{
    return 'MongoDB';
}

            
hasExplain() protected method

protected void hasExplain ( )

                protected function hasExplain()
{
    return true;
}

            
init() public method

public void init ( )

                public function init()
{
    $this->actions['mongodb-explain'] = [
        'class' => 'yii\\mongodb\\debug\\ExplainAction',
        'panel' => $this,
    ];
}