Doctrine\DBAL\Connection::getTransactionNestingLevel PHP Method

getTransactionNestingLevel() public method

Returns the current transaction nesting level.
public getTransactionNestingLevel ( ) : integer
return integer The nesting level. A value of 0 means there's no active transaction.
    public function getTransactionNestingLevel()
    {
        return $this->_transactionNestingLevel;
    }

Usage Example

 /**
  * Begin transaction
  */
 public function beginTransaction()
 {
     if (0 != $this->connection->getTransactionNestingLevel()) {
         throw new \RuntimeException('Transaction already started');
     }
     $this->connection->beginTransaction();
 }
All Usage Examples Of Doctrine\DBAL\Connection::getTransactionNestingLevel