diff --git a/Database/ActiveQuery.php b/Database/ActiveQuery.php index c55b46d6..29592e38 100644 --- a/Database/ActiveQuery.php +++ b/Database/ActiveQuery.php @@ -218,10 +218,9 @@ class ActiveQuery extends Component */ public function all() { - $collect = new Collection($this, - $this->modelClass::getDb()->createCommand($this->queryBuilder())->all() - , $this->modelClass - ); + $collect = new Collection($this, $this->modelClass::getDb() + ->createCommand($this->queryBuilder()) + ->all(), $this->modelClass); if ($this->asArray) { return $collect->toArray(); } @@ -234,7 +233,7 @@ class ActiveQuery extends Component * @return ActiveRecord * @throws Exception */ - public function populate($model, $data) + public function populate(ActiveRecord $model, $data) { return $this->getWith($model::populate($data)); }