original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: 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.
docstring_tokens: Process multiple query results and return model instances .