src/PhpQuickProfiler.php
protected function explainQuery($dbConnection, $query, $parameters = array())
    {
        $driver = $dbConnection->getAttribute(\PDO::ATTR_DRIVER_NAME);
        $query = $this->getExplainQuery($query, $driver);
        $statement = $dbConnection->prepare($query);
        if ($statement === false) {
            throw new Exception('Invalid query passed to explainQuery method');
        }
        $statement->execute($parameters);
        $result = $statement->fetch(\PDO::FETCH_ASSOC);
        if ($result === false) {
            throw new Exception('Query could not be explained with given parameters');
        }
        return $result;
    }
protected function explainQuery($dbConnection, $query, $parameters = array())
    {
        $driver = $dbConnection->getAttribute(\PDO::ATTR_DRIVER_NAME);
        $query = $this->getExplainQuery($query, $driver);
        $statement = $dbConnection->prepare($query);
        if ($statement === false) {
            throw new Exception('Invalid query passed to explainQuery method');
        }
        $statement->execute($parameters);
        $result = $statement->fetch(\PDO::FETCH_ASSOC);
        if ($result === false) {
            throw new Exception('Query could not be explained with given parameters');
        }
        return $result;
    }
protected function explainQuery ( $ dbConnection , $ query , $ parameters = array ( ) ) { $ driver = $ dbConnection -> getAttribute ( \ PDO :: ATTR_DRIVER_NAME ) ; $ query = $ this -> getExplainQuery ( $ query , $ driver ) ; $ statement = $ dbConnection -> prepare ( $ query ) ; if ( $ statement === false ) { throw new Exception ( 'Invalid query passed to explainQuery method' ) ; } $ statement -> execute ( $ parameters ) ; $ result = $ statement -> fetch ( \ PDO :: FETCH_ASSOC ) ; if ( $ result === false ) { throw new Exception ( 'Query could not be explained with given parameters' ) ; } return $ result ; }
Attempts to explain a query

@param object $dbConnection
@param string $query
@param array  $parameters
@throws Exception
@return array
Attempts to explain a query