yii\elasticsearch\ActiveQuery::populate PHP Method

populate() public method

Since: 2.0.4
public populate ( $rows )
    public function populate($rows)
    {
        if (empty($rows)) {
            return [];
        }
        $models = $this->createModels($rows);
        if (!empty($this->with)) {
            $this->findWith($this->with, $models);
        }
        if (!$this->asArray) {
            foreach ($models as $model) {
                $model->afterFind();
            }
        }
        return $models;
    }