public static function executeStatement(
        PDOStatement $statement,
        array $params = null
    ) {
        //Add the statement to the list of those run
        static::addStatement($statement);

        //Add bindings to the statement
        if (is_array($params)) {
            $statement->getBindings()
                ->hydrateFromArray($params);
        }

        $result = static::getOrCreateResultAt(static::numQueries());

        //Add the result to the statement
        $statement->setResult($result);

        //If a transaction is open, add the statement to it
        if (static::inTransaction()) {
            static::currentTransaction()->addStatement($statement);
        }

        //Increment number of queries run
        static::incrementNumQueries();

        if (static::shouldLogBacktrace()) {
            $statement->setBacktrace(
                static::makeBacktraceCollection(
                    debug_backtrace(
                        DEBUG_BACKTRACE_PROVIDE_OBJECT | DEBUG_BACKTRACE_IGNORE_ARGS,
                        static::resolveBacktraceLimit()
                    )
                )
            );
        }
    }
public static function executeStatement(
        PDOStatement $statement,
        array $params = null
    ) {
        //Add the statement to the list of those run
        static::addStatement($statement);

        //Add bindings to the statement
        if (is_array($params)) {
            $statement->getBindings()
                ->hydrateFromArray($params);
        }

        $result = static::getOrCreateResultAt(static::numQueries());

        //Add the result to the statement
        $statement->setResult($result);

        //If a transaction is open, add the statement to it
        if (static::inTransaction()) {
            static::currentTransaction()->addStatement($statement);
        }

        //Increment number of queries run
        static::incrementNumQueries();

        if (static::shouldLogBacktrace()) {
            $statement->setBacktrace(
                static::makeBacktraceCollection(
                    debug_backtrace(
                        DEBUG_BACKTRACE_PROVIDE_OBJECT | DEBUG_BACKTRACE_IGNORE_ARGS,
                        static::resolveBacktraceLimit()
                    )
                )
            );
        }
    }
public static function executeStatement ( PDOStatement $ statement , array $ params = null ) { //Add the statement to the list of those run static :: addStatement ( $ statement ) ; //Add bindings to the statement if ( is_array ( $ params ) ) { $ statement -> getBindings ( ) -> hydrateFromArray ( $ params ) ; } $ result = static :: getOrCreateResultAt ( static :: numQueries ( ) ) ; //Add the result to the statement $ statement -> setResult ( $ result ) ; //If a transaction is open, add the statement to it if ( static :: inTransaction ( ) ) { static :: currentTransaction ( ) -> addStatement ( $ statement ) ; } //Increment number of queries run static :: incrementNumQueries ( ) ; if ( static :: shouldLogBacktrace ( ) ) { $ statement -> setBacktrace ( static :: makeBacktraceCollection ( debug_backtrace ( DEBUG_BACKTRACE_PROVIDE_OBJECT | DEBUG_BACKTRACE_IGNORE_ARGS , static :: resolveBacktraceLimit ( ) ) ) ) ; } }
Records a simulation of a query execution.

@todo Raise an error if there are parameters already bound and params are
provided.

@param  PDOStatement $statement
@param  array        $params
@return void
Records a simulation of a query execution .