src/Db/Orm/ActiveQuery.php
public function populate($rows)
    {
        if (empty($rows)) {
            return resolve([]);
        }

        $models = $this->createModels($rows);
        if (!empty($this->join) && $this->indexBy === null) {
            $models = $this->removeDuplicatedModels($models);
        }
        $promise = !empty($this->with) ? $this->findWith($this->with, $models) : resolve(true);
        return $promise->then(function() use (&$models) {
            if ($this->inverseOf !== null) {
                $this->addInverseRelations($models);
            }

            if (!$this->asArray) {
                foreach ($models as $model) {
                    $model->afterFind();
                }
            }
            return parent::populate($models);
        })->then(function($models) {
            $this->emit($this->eventChildrenInject, [&$models]);
            return $models;
        });
    }
public function populate($rows)
    {
        if (empty($rows)) {
            return resolve([]);
        }

        $models = $this->createModels($rows);
        if (!empty($this->join) && $this->indexBy === null) {
            $models = $this->removeDuplicatedModels($models);
        }
        $promise = !empty($this->with) ? $this->findWith($this->with, $models) : resolve(true);
        return $promise->then(function() use (&$models) {
            if ($this->inverseOf !== null) {
                $this->addInverseRelations($models);
            }

            if (!$this->asArray) {
                foreach ($models as $model) {
                    $model->afterFind();
                }
            }
            return parent::populate($models);
        })->then(function($models) {
            $this->emit($this->eventChildrenInject, [&$models]);
            return $models;
        });
    }
{@inheritdoc}