Increases the depth of transaction nesting.
If no transaction is already active, we begin a new transaction.
Drupal\Core\Database\TransactionNameNonUniqueException
Drupal\Core\Database\Transaction
public function pushTransaction($name) {
if (!$this
->supportsTransactions()) {
return;
}
if (isset($this->transactionLayers[$name])) {
throw new TransactionNameNonUniqueException($name . " is already in use.");
}
// If we're already in a transaction then we want to create a savepoint
// rather than try to create another transaction.
if ($this
->inTransaction()) {
$this
->query('SAVEPOINT ' . $name);
}
else {
parent::beginTransaction();
}
$this->transactionLayers[$name] = $name;
}