Doctrine\DBAL\Connection::isRollbackOnly PHP Method

isRollbackOnly() public method

Checks whether the current transaction is marked for rollback only.
public isRollbackOnly ( ) : boolean
return boolean
    public function isRollbackOnly()
    {
        if ($this->_transactionNestingLevel == 0) {
            throw ConnectionException::noActiveTransaction();
        }
        return $this->_isRollbackOnly;
    }

Usage Example

 public function testIsRollbackOnlyNoActiveTransaction_ThrowsException()
 {
     $this->setExpectedException('Doctrine\\DBAL\\ConnectionException');
     $this->_conn->isRollbackOnly();
 }