yii\mongodb\debug\ExplainAction::run PHP Метод

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

Runs the explain action
public run ( integer $seq, string $tag ) : string
$seq integer
$tag string
Результат string explain result content
    public function run($seq, $tag)
    {
        $this->controller->loadData($tag);
        $timings = $this->panel->calculateTimings();
        if (!isset($timings[$seq])) {
            throw new HttpException(404, 'Log message not found.');
        }
        $query = $timings[$seq]['info'];
        if (strpos($query, 'find({') !== 0) {
            return '';
        }
        $query = substr($query, strlen('find('), -1);
        $result = $this->explainQuery($query);
        if (!$result) {
            return '';
        }
        return Json::encode($result, JSON_PRETTY_PRINT);
    }