modify plugin name
This commit is contained in:
+4
-10
@@ -106,7 +106,7 @@ class Connection extends Component
|
|||||||
*/
|
*/
|
||||||
public function getConnect($isSearch): PDO
|
public function getConnect($isSearch): PDO
|
||||||
{
|
{
|
||||||
return !$isSearch ? $this->getMasterClient() : $this->getSlaveClient();
|
return !$isSearch ? $this->getPdo() : $this->getSlaveClient();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -149,9 +149,6 @@ class Connection extends Component
|
|||||||
*/
|
*/
|
||||||
public function getMasterClient(): PDO
|
public function getMasterClient(): PDO
|
||||||
{
|
{
|
||||||
if ($this->_pdo instanceof PDO) {
|
|
||||||
return $this->_pdo;
|
|
||||||
}
|
|
||||||
return $this->connections()->get([
|
return $this->connections()->get([
|
||||||
'cds' => $this->cds,
|
'cds' => $this->cds,
|
||||||
'username' => $this->username,
|
'username' => $this->username,
|
||||||
@@ -171,7 +168,7 @@ class Connection extends Component
|
|||||||
public function getSlaveClient(): PDO
|
public function getSlaveClient(): PDO
|
||||||
{
|
{
|
||||||
if (empty($this->slaveConfig) || $this->slaveConfig['cds'] == $this->cds) {
|
if (empty($this->slaveConfig) || $this->slaveConfig['cds'] == $this->cds) {
|
||||||
return $this->getMasterClient();
|
return $this->getPdo();
|
||||||
}
|
}
|
||||||
return $this->connections()->get($this->slaveConfig);
|
return $this->connections()->get($this->slaveConfig);
|
||||||
}
|
}
|
||||||
@@ -193,7 +190,7 @@ class Connection extends Component
|
|||||||
*/
|
*/
|
||||||
public function beginTransaction(): static
|
public function beginTransaction(): static
|
||||||
{
|
{
|
||||||
$pdo = $this->getMasterClient();
|
$pdo = $this->getPdo();
|
||||||
$pdo->beginTransaction();
|
$pdo->beginTransaction();
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
@@ -217,10 +214,7 @@ class Connection extends Component
|
|||||||
*/
|
*/
|
||||||
public function inTransaction(): bool|static
|
public function inTransaction(): bool|static
|
||||||
{
|
{
|
||||||
if (!$this->_pdo) {
|
return $this->getPdo()->inTransaction();
|
||||||
$this->_pdo = $this->getMasterClient();
|
|
||||||
}
|
|
||||||
return $this->_pdo->inTransaction();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user