protected function processMultipleResults($query)
    {
        if (!empty($this->fetchRefs)) {
            $models = [];
            foreach ($query->fetchAll() as $model) {
                $models[] = $this->populateModelFromJoin($model);
            }
        } else {
            $models = $query->fetchAllClass($this->modelClass);
        }
        if (isset($this->manager)) {
            foreach ($models as $model) {
                $this->manager->manageModel($model);
            }
        }
        $this->fetchReferences(false);
        return $models;
    }
protected function processMultipleResults($query)
    {
        if (!empty($this->fetchRefs)) {
            $models = [];
            foreach ($query->fetchAll() as $model) {
                $models[] = $this->populateModelFromJoin($model);
            }
        } else {
            $models = $query->fetchAllClass($this->modelClass);
        }
        if (isset($this->manager)) {
            foreach ($models as $model) {
                $this->manager->manageModel($model);
            }
        }
        $this->fetchReferences(false);
        return $models;
    }
protected function processMultipleResults ( $ query ) { if ( ! empty ( $ this -> fetchRefs ) ) { $ models = [ ] ; foreach ( $ query -> fetchAll ( ) as $ model ) { $ models [ ] = $ this -> populateModelFromJoin ( $ model ) ; } } else { $ models = $ query -> fetchAllClass ( $ this -> modelClass ) ; } if ( isset ( $ this -> manager ) ) { foreach ( $ models as $ model ) { $ this -> manager -> manageModel ( $ model ) ; } } $ this -> fetchReferences ( false ) ; return $ models ; }
Process multiple query results and return model instances.

@param \Anax\Database\DatabaseQueryBuilder   $query  Database service instance with executed internal query.

@return array                                        Array of model instances.
Process multiple query results and return model instances .