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:
Carsten Brandt
2014-02-03 14:01:29 +01:00
parent dc4feef716
commit 16e1aff41b
15 changed files with 65 additions and 40 deletions

View File

@ -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];

View File

@ -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];