改名
This commit is contained in:
@@ -111,7 +111,6 @@ abstract class AbstractCollection extends Component implements \IteratorAggregat
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
* @throws ComponentException
|
||||
* @throws Exception
|
||||
*/
|
||||
public function getModel(): ActiveRecord
|
||||
|
||||
@@ -57,13 +57,7 @@ class CollectionIterator extends \ArrayIterator
|
||||
*/
|
||||
protected function newModel($current): ActiveRecord
|
||||
{
|
||||
/** @var ActiveRecord|string $model */
|
||||
$model = $this->model;
|
||||
if (is_object($model)) {
|
||||
$model = get_class($model);
|
||||
}
|
||||
$model = new $model();
|
||||
return $model->setAttributes($current);
|
||||
return $this->model::populate($current);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user