src/TransactionDatabase.php
public function rollback() : bool
    {
        $sql = 'ROLLBACK';

        if (!$this->transactionStarted) {
            $event = new TimerEvent('db.query');
            $this->emitQueryEvent($event, null, $sql);

            throw new QueryException(
                $this,
                $sql,
                "Can't rollback unstarted transaction"
            );
        }

        $this->query($sql);
        $this->transactionStarted = false;

        $this->instanceDispatcher()->emit(new Event('db.rollback'));

        return true;
    }
public function rollback() : bool
    {
        $sql = 'ROLLBACK';

        if (!$this->transactionStarted) {
            $event = new TimerEvent('db.query');
            $this->emitQueryEvent($event, null, $sql);

            throw new QueryException(
                $this,
                $sql,
                "Can't rollback unstarted transaction"
            );
        }

        $this->query($sql);
        $this->transactionStarted = false;

        $this->instanceDispatcher()->emit(new Event('db.rollback'));

        return true;
    }
public function rollback ( ) : bool { $ sql = 'ROLLBACK' ; if ( ! $ this -> transactionStarted ) { $ event = new TimerEvent ( 'db.query' ) ; $ this -> emitQueryEvent ( $ event , null , $ sql ) ; throw new QueryException ( $ this , $ sql , "Can't rollback unstarted transaction" ) ; } $ this -> query ( $ sql ) ; $ this -> transactionStarted = false ; $ this -> instanceDispatcher ( ) -> emit ( new Event ( 'db.rollback' ) ) ; return true ; }
Rollback a sql transaction.

@throws QueryException

@return bool
Rollback a sql transaction .