This commit is contained in:
2023-04-06 22:43:43 +08:00
parent 3d8c01a42c
commit fe1711325b
2 changed files with 24 additions and 23 deletions
+2 -2
View File
@@ -178,7 +178,7 @@ class Connection extends Component
* @return PDO
* @throws Exception
*/
public function getMasterClient(): PDO
public function getConnection(): PDO
{
$client = $this->connections->get($this->cds);
if ($client === false) {
@@ -208,7 +208,7 @@ class Connection extends Component
{
$pdo = Context::get($this->cds);
if ($pdo === null) {
$pdo = $this->getMasterClient();
$pdo = $this->getConnection();
}
$pdo->beginTransaction();
return $this;