mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-03 22:32:40 +08:00
Fixes #14059: Removed unused AR instantiating for calling of static methods
This commit is contained in:
committed by
Alexander Makarov
parent
375ea7a847
commit
d7fad8a555
@ -83,6 +83,7 @@ Yii Framework 2 Change Log
|
|||||||
- Enh #13976: Disabled IPv6 check on `\yii\validators\IpValidator` as it turns out it is not needed for inet_* methods to work (mikk150)
|
- Enh #13976: Disabled IPv6 check on `\yii\validators\IpValidator` as it turns out it is not needed for inet_* methods to work (mikk150)
|
||||||
- Enh #13981: `yii\caching\Cache::getOrSet()` now supports both `Closure` and `callable` (silverfire)
|
- Enh #13981: `yii\caching\Cache::getOrSet()` now supports both `Closure` and `callable` (silverfire)
|
||||||
- Enh #13911: Significantly enhanced MSSQL schema reading performance (paulzi, WebdevMerlion)
|
- Enh #13911: Significantly enhanced MSSQL schema reading performance (paulzi, WebdevMerlion)
|
||||||
|
- Enh #14059: Removed unused AR instantiating for calling of static methods (ElisDN)
|
||||||
|
|
||||||
2.0.11.2 February 08, 2017
|
2.0.11.2 February 08, 2017
|
||||||
--------------------------
|
--------------------------
|
||||||
|
|||||||
@ -276,9 +276,8 @@ class QueryBuilder extends \yii\db\QueryBuilder
|
|||||||
if (!$modelClass) {
|
if (!$modelClass) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
/* @var $model \yii\db\ActiveRecord */
|
/* @var $modelClass \yii\db\ActiveRecord */
|
||||||
$model = new $modelClass;
|
$schema = $modelClass::getTableSchema();
|
||||||
$schema = $model->getTableSchema();
|
|
||||||
return array_keys($schema->columns);
|
return array_keys($schema->columns);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -65,10 +65,8 @@ abstract class BaseActiveFixture extends DbFixture implements \IteratorAggregate
|
|||||||
$row = $this->data[$name];
|
$row = $this->data[$name];
|
||||||
/* @var $modelClass \yii\db\ActiveRecord */
|
/* @var $modelClass \yii\db\ActiveRecord */
|
||||||
$modelClass = $this->modelClass;
|
$modelClass = $this->modelClass;
|
||||||
/* @var $model \yii\db\ActiveRecord */
|
|
||||||
$model = new $modelClass;
|
|
||||||
$keys = [];
|
$keys = [];
|
||||||
foreach ($model->primaryKey() as $key) {
|
foreach ($modelClass::primaryKey() as $key) {
|
||||||
$keys[$key] = isset($row[$key]) ? $row[$key] : null;
|
$keys[$key] = isset($row[$key]) ? $row[$key] : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user