变更
This commit is contained in:
+3
-6
@@ -145,7 +145,7 @@ class Connection extends Component
|
||||
* @return PDO
|
||||
* @throws Exception
|
||||
*/
|
||||
public function getMasterClient(): PDO
|
||||
public function getMasterClient(): Mysql\PDO
|
||||
{
|
||||
return $this->connection->get([
|
||||
'cds' => $this->cds,
|
||||
@@ -163,7 +163,7 @@ class Connection extends Component
|
||||
* @return PDO
|
||||
* @throws Exception
|
||||
*/
|
||||
public function getSlaveClient(): PDO
|
||||
public function getSlaveClient(): Mysql\PDO
|
||||
{
|
||||
return $this->getMasterClient();
|
||||
}
|
||||
@@ -185,14 +185,11 @@ class Connection extends Component
|
||||
* @return PDO
|
||||
* @throws Exception
|
||||
*/
|
||||
public function getPdo(bool $restore = false): PDO
|
||||
public function getPdo(bool $restore = false): Mysql\PDO
|
||||
{
|
||||
if ($restore === true) {
|
||||
return Context::setContext($this->cds, $this->getMasterClient());
|
||||
}
|
||||
if (!Db::inTransactionsActive()) {
|
||||
return $this->getMasterClient();
|
||||
}
|
||||
if (!Context::hasContext($this->cds)) {
|
||||
return Context::setContext($this->cds, $this->getMasterClient());
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user