You are here

public function Connection::startTransaction in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Database/Connection.php \Drupal\Core\Database\Connection::startTransaction()

Returns a new DatabaseTransaction object on this connection.

Parameters

string $name: (optional) The name of the savepoint.

Return value

\Drupal\Core\Database\Transaction A Transaction object.

See also

\Drupal\Core\Database\Transaction

1 call to Connection::startTransaction()
Connection::nextId in core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php
Retrieves a unique ID from a given sequence.

File

core/lib/Drupal/Core/Database/Connection.php, line 1495

Class

Connection
Base Database API class.

Namespace

Drupal\Core\Database

Code

public function startTransaction($name = '') {
  $class = $this
    ->getDriverClass('Transaction');
  return new $class($this, $name);
}