mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-18 23:43:19 +08:00
Fixed issue #7674
This commit is contained in:
committed by
SilverFire - Dmitry Naumenko
parent
91204dd6c6
commit
aa36f63f4c
@@ -337,6 +337,12 @@ class Connection extends Component
|
|||||||
* @see masterConfig
|
* @see masterConfig
|
||||||
*/
|
*/
|
||||||
public $masters = [];
|
public $masters = [];
|
||||||
|
/**
|
||||||
|
* @var string the class name of the [[Command]] object.
|
||||||
|
*/
|
||||||
|
public $commandClass = 'yii\db\Command';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array the configuration that should be merged with every master configuration listed in [[masters]].
|
* @var array the configuration that should be merged with every master configuration listed in [[masters]].
|
||||||
* For example,
|
* For example,
|
||||||
@@ -618,9 +624,10 @@ class Connection extends Component
|
|||||||
*/
|
*/
|
||||||
public function createCommand($sql = null, $params = [])
|
public function createCommand($sql = null, $params = [])
|
||||||
{
|
{
|
||||||
$command = new Command([
|
$command = Yii::createObject([
|
||||||
|
'class' => $this->commandClass,
|
||||||
'db' => $this,
|
'db' => $this,
|
||||||
'sql' => $sql,
|
'sql' => $sql
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return $command->bindValues($params);
|
return $command->bindValues($params);
|
||||||
|
|||||||
Reference in New Issue
Block a user