| Versionen | |
|---|---|
| drupal7 | db_transaction($required = FALSE, Array $options = array()) |
Returns a new transaction object for the active database.
$required TRUE if the calling code will not function properly without transaction support. If set to TRUE and the active database does not support transactions a TransactionsNotSupportedException exception will be thrown.
$options An array of options to control how the transaction operates. Only the target key has any meaning in this case.
A new DatabaseTransaction object for this connection.
includes/
<?php
function db_transaction($required = FALSE, Array $options = array()) {
if (empty($options['target'])) {
$options['target'] = 'default';
}
return Database::getConnection($options['target'])->startTransaction($required);
}
?>
Kommentare
Kommentar hinzufügen