| Versionen | |
|---|---|
| drupal7 | public DatabaseConnection::startTransaction($required = FALSE) |
Returns a new DatabaseTransaction object on this connection.
$required If executing an operation that absolutely must use transactions, specify TRUE for this parameter. If the connection does not support transactions, this method will throw an exception and the operation will not be possible.
includes/
<?php
public function startTransaction($required = FALSE) {
if ($required && !$this->supportsTransactions()) {
throw new TransactionsNotSupportedException();
}
if (empty($this->transactionClass)) {
$this->transactionClass = 'DatabaseTransaction_' . $this->driver();
if (!class_exists($this->transactionClass)) {
$this->transactionClass = 'DatabaseTransaction';
}
}
return new $this->transactionClass($this);
}
?>
Kommentare
Kommentar hinzufügen