public function populate($rows)
    {
        if (empty($rows)) {
            return [];
        }

        $indexBy = $this->indexBy;
        $this->indexBy = null;
        $rows = parent::populate($rows);
        $this->indexBy = $indexBy;

        $models = $this->createModels($rows);

        if (!empty($this->with)) {
            $this->findWith($this->with, $models);
        }
        if (!$this->asArray) {
            foreach ($models as $model) {
                $model->afterFind();
            }
        }

        return parent::populate($models);
    }