This commit is contained in:
2021-04-23 10:28:11 +08:00
parent 8904df7dff
commit 011424b54b
2 changed files with 1 additions and 8 deletions
-1
View File
@@ -111,7 +111,6 @@ abstract class AbstractCollection extends Component implements \IteratorAggregat
/** /**
* @return mixed * @return mixed
* @throws ComponentException
* @throws Exception * @throws Exception
*/ */
public function getModel(): ActiveRecord public function getModel(): ActiveRecord
+1 -7
View File
@@ -57,13 +57,7 @@ class CollectionIterator extends \ArrayIterator
*/ */
protected function newModel($current): ActiveRecord protected function newModel($current): ActiveRecord
{ {
/** @var ActiveRecord|string $model */ return $this->model::populate($current);
$model = $this->model;
if (is_object($model)) {
$model = get_class($model);
}
$model = new $model();
return $model->setAttributes($current);
} }