original_string: public function getCalculationFields(array $fieldData)
      {
          $output = array();
  
          // Perform automatic calculation
          if (isset($this->_fieldDefinition['gtf_calculate_using'])) {
              $sources = explode(self::FIELD_SEP, $this->_fieldDefinition['gtf_calculate_using']);
  
              foreach ($sources as $source) {
                  if (isset($fieldData[$source]) && $fieldData[$source]) {
                      $output[$source] = $fieldData[$source];
                  } else {
                      $output[$source] = null;
                  }
              }
          }
          return array_reverse($output, true);
      }
code: public function getCalculationFields(array $fieldData)
      {
          $output = array();
  
          // Perform automatic calculation
          if (isset($this->_fieldDefinition['gtf_calculate_using'])) {
              $sources = explode(self::FIELD_SEP, $this->_fieldDefinition['gtf_calculate_using']);
  
              foreach ($sources as $source) {
                  if (isset($fieldData[$source]) && $fieldData[$source]) {
                      $output[$source] = $fieldData[$source];
                  } else {
                      $output[$source] = null;
                  }
              }
          }
          return array_reverse($output, true);
      }
code_tokens: public function getCalculationFields ( array $ fieldData ) { $ output = array ( ) ; // Perform automatic calculation if ( isset ( $ this -> _fieldDefinition [ 'gtf_calculate_using' ] ) ) { $ sources = explode ( self :: FIELD_SEP , $ this -> _fieldDefinition [ 'gtf_calculate_using' ] ) ; foreach ( $ sources as $ source ) { if ( isset ( $ fieldData [ $ source ] ) && $ fieldData [ $ source ] ) { $ output [ $ source ] = $ fieldData [ $ source ] ; } else { $ output [ $ source ] = null ; } } } return array_reverse ( $ output , true ) ; }
docstring: Get the fields that should be used for calculation,
  first field to use first.
  
  I.e. the last selected field in field maintenance
  is the first field in the output array.
  
  @param array $fieldData The fields being saved
  @return array [fieldKey => fieldValue]
docstring_tokens: Get the fields that should be used for calculation first field to use first .