qqq
This commit is contained in:
+19
-19
@@ -171,25 +171,6 @@ class Connection extends Component
|
|||||||
return $this->getNormalClientHealth();
|
return $this->getNormalClientHealth();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return $this
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
public function beginTransaction(): static
|
|
||||||
{
|
|
||||||
if ($this->storey == 0) {
|
|
||||||
/** @var PDO $pdo */
|
|
||||||
$pdo = Context::get($this->cds);
|
|
||||||
if ($pdo instanceof PDO && !$pdo->inTransaction()) {
|
|
||||||
$pdo->beginTransaction();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$this->storey++;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param PDO|null $client
|
* @param PDO|null $client
|
||||||
* @return bool
|
* @return bool
|
||||||
@@ -210,6 +191,25 @@ class Connection extends Component
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return $this
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public function beginTransaction(): static
|
||||||
|
{
|
||||||
|
if ($this->storey == 0) {
|
||||||
|
/** @var PDO $pdo */
|
||||||
|
$pdo = Context::get($this->cds);
|
||||||
|
if ($pdo instanceof PDO && !$pdo->inTransaction()) {
|
||||||
|
$pdo->beginTransaction();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$this->storey++;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return PDO
|
* @return PDO
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
|
|||||||
Reference in New Issue
Block a user