public beginTransaction ( ) : void | ||
Résultat | void |
public function beginTransaction()
{
$this->connect();
++$this->_transactionNestingLevel;
$logger = $this->_config->getSQLLogger();
if ($this->_transactionNestingLevel == 1) {
if ($logger) {
$logger->startQuery('"START TRANSACTION"');
}
$this->_conn->beginTransaction();
if ($logger) {
$logger->stopQuery();
}
} elseif ($this->_nestTransactionsWithSavepoints) {
if ($logger) {
$logger->startQuery('"SAVEPOINT"');
}
$this->createSavepoint($this->_getNestedTransactionSavePointName());
if ($logger) {
$logger->stopQuery();
}
}
}
/** * Starts a new transactional block, if none is open, or silently completes, if the transaction * is already opened. */ public function requestTransaction() { if (!$this->inTransaction) { $this->conn->beginTransaction(); $this->inTransaction = true; } }