original_string: public function getTrackFields($requests)
      {
          $token   = $this->token;
          $results = [];
  
          // Read fieldcodes and convert to uppercase since requests are uppercase too
          $respondentTrack = $token->getRespondentTrack();
          $fieldCodes      = $respondentTrack->getCodeFields();
          $rawFieldData    = $respondentTrack->getFieldData();    // Date (time) fields are unprocessed here
          $keysMixed       = array_keys($fieldCodes);
          $keysUpper       = array_change_key_case($fieldCodes, CASE_UPPER);
          $fieldCodesMap   = array_combine(array_keys($keysUpper), $keysMixed);
  
          foreach ($requests as $original => $upperField) {
              if (array_key_exists($upperField, $fieldCodesMap)) {
                  $trackField         = $fieldCodesMap[$upperField];
                  $value              = $fieldCodes[$trackField];
                  // If it is a date(/time) field export it in ISO format
                  if (array_key_exists($trackField, $rawFieldData) && $rawFieldData[$trackField] instanceof \MUtil_Date) {
                      $value = $rawFieldData[$trackField]->get('yyyy-MM-dd HH:mm:ss');
                  }
                  $results[$original] = $value;
              }
          }
  
          return $results;
      }
code: public function getTrackFields($requests)
      {
          $token   = $this->token;
          $results = [];
  
          // Read fieldcodes and convert to uppercase since requests are uppercase too
          $respondentTrack = $token->getRespondentTrack();
          $fieldCodes      = $respondentTrack->getCodeFields();
          $rawFieldData    = $respondentTrack->getFieldData();    // Date (time) fields are unprocessed here
          $keysMixed       = array_keys($fieldCodes);
          $keysUpper       = array_change_key_case($fieldCodes, CASE_UPPER);
          $fieldCodesMap   = array_combine(array_keys($keysUpper), $keysMixed);
  
          foreach ($requests as $original => $upperField) {
              if (array_key_exists($upperField, $fieldCodesMap)) {
                  $trackField         = $fieldCodesMap[$upperField];
                  $value              = $fieldCodes[$trackField];
                  // If it is a date(/time) field export it in ISO format
                  if (array_key_exists($trackField, $rawFieldData) && $rawFieldData[$trackField] instanceof \MUtil_Date) {
                      $value = $rawFieldData[$trackField]->get('yyyy-MM-dd HH:mm:ss');
                  }
                  $results[$original] = $value;
              }
          }
  
          return $results;
      }
code_tokens: public function getTrackFields ( $ requests ) { $ token = $ this -> token ; $ results = [ ] ; // Read fieldcodes and convert to uppercase since requests are uppercase too $ respondentTrack = $ token -> getRespondentTrack ( ) ; $ fieldCodes = $ respondentTrack -> getCodeFields ( ) ; $ rawFieldData = $ respondentTrack -> getFieldData ( ) ; // Date (time) fields are unprocessed here $ keysMixed = array_keys ( $ fieldCodes ) ; $ keysUpper = array_change_key_case ( $ fieldCodes , CASE_UPPER ) ; $ fieldCodesMap = array_combine ( array_keys ( $ keysUpper ) , $ keysMixed ) ; foreach ( $ requests as $ original => $ upperField ) { if ( array_key_exists ( $ upperField , $ fieldCodesMap ) ) { $ trackField = $ fieldCodesMap [ $ upperField ] ; $ value = $ fieldCodes [ $ trackField ] ; // If it is a date(/time) field export it in ISO format if ( array_key_exists ( $ trackField , $ rawFieldData ) && $ rawFieldData [ $ trackField ] instanceof \ MUtil_Date ) { $ value = $ rawFieldData [ $ trackField ] -> get ( 'yyyy-MM-dd HH:mm:ss' ) ; } $ results [ $ original ] = $ value ; } } return $ results ; }
docstring: Tries to fulfill request to track fields
  
  @param array $requests
  @return array
docstring_tokens: Tries to fulfill request to track fields