File
 
   - drupal/core/lib/Drupal/Core/Database/Transaction.php, line 53
- Definition of Drupal\Core\Database\Transaction
Class
  
  - Transaction 
- A wrapper class for creating and managing database transactions.
Namespace
  Drupal\Core\Database
Code
public function __construct(Connection $connection, $name = NULL) {
  $this->connection = $connection;
  
  if (!($depth = $connection
    ->transactionDepth())) {
    $this->name = 'drupal_transaction';
  }
  elseif (!$name) {
    $this->name = 'savepoint_' . $depth;
  }
  else {
    $this->name = $name;
  }
  $this->connection
    ->pushTransaction($this->name);
}