This commit is contained in:
2021-04-25 17:01:57 +08:00
parent 4b0e457318
commit c17647859a
5 changed files with 204 additions and 163 deletions
+3 -4
View File
@@ -115,11 +115,10 @@ abstract class AbstractCollection extends Component implements \IteratorAggregat
*/
public function getModel(): ActiveRecord
{
$model = $this->model;;
if (is_object($model)) {
return $model;
if (!is_object($this->model)) {
$this->model = $this->model::populate([]);
}
return $model::populate([]);
return $this->model;
}