original_string: public function set_data_from_engine($docdata) {
          $fields = static::$requiredfields + static::$optionalfields + static::$enginefields;
          foreach ($fields as $fieldname => $field) {
  
              // Optional params might not be there.
              if (isset($docdata[$fieldname])) {
                  if ($field['type'] === 'tdate') {
                      // Time fields may need a preprocessing.
                      $this->set($fieldname, static::import_time_from_engine($docdata[$fieldname]));
                  } else {
                      // No way we can make this work if there is any multivalue field.
                      if (is_array($docdata[$fieldname])) {
                          throw new \core_search\engine_exception('multivaluedfield', 'search_solr', '', $fieldname);
                      }
                      $this->set($fieldname, $docdata[$fieldname]);
                  }
              }
          }
      }
code: public function set_data_from_engine($docdata) {
          $fields = static::$requiredfields + static::$optionalfields + static::$enginefields;
          foreach ($fields as $fieldname => $field) {
  
              // Optional params might not be there.
              if (isset($docdata[$fieldname])) {
                  if ($field['type'] === 'tdate') {
                      // Time fields may need a preprocessing.
                      $this->set($fieldname, static::import_time_from_engine($docdata[$fieldname]));
                  } else {
                      // No way we can make this work if there is any multivalue field.
                      if (is_array($docdata[$fieldname])) {
                          throw new \core_search\engine_exception('multivaluedfield', 'search_solr', '', $fieldname);
                      }
                      $this->set($fieldname, $docdata[$fieldname]);
                  }
              }
          }
      }
code_tokens: public function set_data_from_engine ( $ docdata ) { $ fields = static :: $ requiredfields + static :: $ optionalfields + static :: $ enginefields ; foreach ( $ fields as $ fieldname => $ field ) { // Optional params might not be there. if ( isset ( $ docdata [ $ fieldname ] ) ) { if ( $ field [ 'type' ] === 'tdate' ) { // Time fields may need a preprocessing. $ this -> set ( $ fieldname , static :: import_time_from_engine ( $ docdata [ $ fieldname ] ) ) ; } else { // No way we can make this work if there is any multivalue field. if ( is_array ( $ docdata [ $ fieldname ] ) ) { throw new \ core_search \ engine_exception ( 'multivaluedfield' , 'search_solr' , '' , $ fieldname ) ; } $ this -> set ( $ fieldname , $ docdata [ $ fieldname ] ) ; } } } }
docstring: Fills the document with data coming from the search engine.
  
  @throws \core_search\engine_exception
  @param array $docdata
  @return void
docstring_tokens: Fills the document with data coming from the search engine .