本文整理汇总了PHP中Illuminate\Database\Query\Grammars\Grammar::compileSavepoint方法的典型用法代码示例。如果您正苦于以下问题:PHP Grammar::compileSavepoint方法的具体用法?PHP Grammar::compileSavepoint怎么用?PHP Grammar::compileSavepoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Database\Query\Grammars\Grammar
的用法示例。
在下文中一共展示了Grammar::compileSavepoint方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: beginTransaction
/**
* Start a new database transaction.
*
* @return void
*/
public function beginTransaction()
{
++$this->transactions;
if ($this->transactions == 1) {
$this->getPdo()->beginTransaction();
} elseif ($this->transactions > 1 && $this->queryGrammar->supportsSavepoints()) {
$this->getPdo()->exec($this->queryGrammar->compileSavepoint('trans' . $this->transactions));
}
$this->fireConnectionEvent('beganTransaction');
}
示例2: beginTransaction
/**
* Start a new database transaction.
*
* @return void
* @throws Exception
*/
public function beginTransaction()
{
++$this->transactions;
if ($this->transactions == 1) {
try {
$this->pdo->beginTransaction();
} catch (Exception $e) {
--$this->transactions;
throw $e;
}
} elseif ($this->transactions > 1 && $this->queryGrammar->supportsSavepoints()) {
$this->pdo->exec($this->queryGrammar->compileSavepoint('trans' . $this->transactions));
}
$this->fireConnectionEvent('beganTransaction');
}
示例3: beginTransaction
/**
* Start a new database transaction.
*
* @return void
* @throws Exception
*/
public function beginTransaction()
{
if ($this->transactions == 0) {
try {
$this->getPdo()->beginTransaction();
} catch (Exception $e) {
if ($this->causedByLostConnection($e)) {
$this->reconnect();
$this->pdo->beginTransaction();
} else {
throw $e;
}
}
} elseif ($this->transactions >= 1 && $this->queryGrammar->supportsSavepoints()) {
$this->getPdo()->exec($this->queryGrammar->compileSavepoint('trans' . ($this->transactions + 1)));
}
++$this->transactions;
$this->fireConnectionEvent('beganTransaction');
}