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);
    }
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);
    }
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 ) ; }
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]
Get the fields that should be used for calculation first field to use first .