mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 06:15:19 +08:00
renamed ActiveRecord::create() to populateRecord()
- refactored elasticsearch AR to make type and index available in instantiate(), issue #1313 fixes #2281
This commit is contained in:
@ -81,7 +81,8 @@ class ActiveQuery extends Query implements ActiveQueryInterface
|
||||
} else {
|
||||
/** @var ActiveRecord $class */
|
||||
$class = $this->modelClass;
|
||||
$model = $class::create($row);
|
||||
$model = $class::instantiate($row);
|
||||
$class::populateRecord($model, $row);
|
||||
}
|
||||
if (!empty($this->with)) {
|
||||
$models = [$model];
|
||||
|
@ -81,7 +81,8 @@ class ActiveQuery extends Query implements ActiveQueryInterface
|
||||
} else {
|
||||
/** @var ActiveRecord $class */
|
||||
$class = $this->modelClass;
|
||||
$model = $class::create($row);
|
||||
$model = $class::instantiate($row);
|
||||
$class::populateRecord($model, $row);
|
||||
}
|
||||
if (!empty($this->with)) {
|
||||
$models = [$model];
|
||||
|
Reference in New Issue
Block a user