Pushes a new Drupal transaction on the stack.

This begins a client connection transaction if there is not one active, or adds a savepoint to the active one.

This method should only be called internally by a database driver.

Parameters

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

Return value

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

Throws

\Drupal\Core\Database\TransactionNameNonUniqueException If a Drupal Transaction with the specified name exists already.

File

core/lib/Drupal/Core/Database/Transaction/TransactionManagerInterface.php, line 50

Class

TransactionManagerInterface
Interface for the database transaction manager classes.

Namespace

Drupal\Core\Database\Transaction

Code

public function push(string $name = '') : Transaction;