original_string: protected function processSingleResult($query)
      {
          if (!empty($this->fetchRefs)) {
              $res = $query->fetch();
              $model = ($res ? $this->populateModelFromJoin($res) : $res);
          } else {
              $model = $query->fetchClass($this->modelClass);
          }
          if ($model && isset($this->manager)) {
              $this->manager->manageModel($model);
          }
          $this->fetchReferences(false);
          return $model;
      }
code: protected function processSingleResult($query)
      {
          if (!empty($this->fetchRefs)) {
              $res = $query->fetch();
              $model = ($res ? $this->populateModelFromJoin($res) : $res);
          } else {
              $model = $query->fetchClass($this->modelClass);
          }
          if ($model && isset($this->manager)) {
              $this->manager->manageModel($model);
          }
          $this->fetchReferences(false);
          return $model;
      }
code_tokens: protected function processSingleResult ( $ query ) { if ( ! empty ( $ this -> fetchRefs ) ) { $ res = $ query -> fetch ( ) ; $ model = ( $ res ? $ this -> populateModelFromJoin ( $ res ) : $ res ) ; } else { $ model = $ query -> fetchClass ( $ this -> modelClass ) ; } if ( $ model && isset ( $ this -> manager ) ) { $ this -> manager -> manageModel ( $ model ) ; } $ this -> fetchReferences ( false ) ; return $ model ; }
docstring: Process single query result and return model instance.
  
  @param \Anax\Database\DatabaseQueryBuilder   $query  Database service instance with executed internal query.
  
  @return mixed                                        Model instance.
docstring_tokens: Process single query result and return model instance .