mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-03 05:48:11 +08:00
Added support for cloning a db connection
improved fix #14020 fixes #13890 https://github.com/yiisoft/yii2/pull/14020/files#r115185865 close #14121
This commit is contained in:
@ -1080,4 +1080,18 @@ class Connection extends Component
|
||||
$this->close();
|
||||
return array_keys((array) $this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset the connection after cloning.
|
||||
*/
|
||||
public function __clone()
|
||||
{
|
||||
parent::__clone();
|
||||
|
||||
$this->_master = false;
|
||||
$this->_slave = false;
|
||||
$this->pdo = null;
|
||||
$this->_schema = null;
|
||||
$this->_transaction = null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user