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]
337342
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);
    }
514668
public function onFieldDataSave($currentValue, array $fieldData)
    {
        if ((null === $currentValue) ||
                ($currentValue instanceof \Zend_Db_Expr) ||
                \MUtil_String::startsWith($currentValue, 'current_', true)) {
            return $currentValue;
        }

        $saveFormat = $this->getStorageFormat();

        if ($currentValue instanceof \Zend_Date) {
            return $currentValue->toString($saveFormat);

        } else {
            $displayFormat = $this->getDateFormat();

            $saveDate = \MUtil_Date::ifDate($currentValue, array($displayFormat, $saveFormat, \Gems_Tracker::DB_DATETIME_FORMAT));
            if ($saveDate instanceof \Zend_Date) {
                return $saveDate->toString($saveFormat);
            }
        }

        return (string) $currentValue;
    }
699148
protected function getFieldValue($field, $data)
    {
        $value = null;
        if (isset($data[$field['name']])) {
            $value = $data[$field['name']];
        }
        return $value;
    }
509203
public function calculateFieldInfo($currentValue, array $fieldData)
    {
        if (! $currentValue) {
            return $currentValue;
        }

        // Display nice
        $sql = $this->_sql . "WHERE grr_id = ?";
        $row = $this->db->fetchRow($sql, $currentValue);

        if ($row && isset($row['name'])) {
            return $row['name'];
        }

        return $currentValue;
    }
1338844
private function prepareValues($arrayData)
    {
        $arrayData = array_values($arrayData);

        $preparedValues = [];
        $vNumber = 1;
        foreach ($arrayData as $value) {
            $preparedValues[":value{$vNumber}"] = "$value";
            $vNumber++;
        }

        unset($arrayData);
        unset($vNumber);

        return $preparedValues;
    }
228400
public function makePostFields($postdata) {
        if (is_object($postdata) && !self::isCurlFile($postdata)) {
            $postdata = (array)$postdata;
        }
        $postFields = array();
        foreach ($postdata as $name => $value) {
            $name = urlencode($name);
            if (is_object($value) && !self::isCurlFile($value)) {
                $value = (array)$value;
            }
            if (is_array($value) && !self::isCurlFile($value)) {
                $postFields = $this->makeArrayField($name, $value, $postFields);
            } else {
                $postFields[$name] = $value;
            }
        }
        return $postFields;
    }
809532
public function getFilteredFields()
    {
        $filteredFields = array();
        foreach ($this->_fields as $fieldName => $data) {
            $filteredFields[$fieldName] = $data['value'];
        }
        return $filteredFields;
    }
398052
public function getValues($fieldset = null, $group = null)
    {
        $data = [];

        foreach ($this->getFields($fieldset, $group) as $name => $field) {
            FormHelper::setByPath($data, $name, $field->getRawValue());
        }

        return $data;
    }
879889
public function field_data()
	{
		$retval = array();

		for ($i = 0, $c = $this->num_fields(); $i < $c; $i++)
		{
			$retval[$i]			= new stdClass();
			$retval[$i]->name		= cubrid_field_name($this->result_id, $i);
			$retval[$i]->type		= cubrid_field_type($this->result_id, $i);
			$retval[$i]->max_length		= cubrid_field_len($this->result_id, $i);
			$retval[$i]->primary_key	= (int) (strpos(cubrid_field_flags($this->result_id, $i), 'primary_key') !== FALSE);
		}

		return $retval;
	}
605877
public function cuSelectOneDataSet($tableName, $fieldName, $fieldValue)
    {

        $where         = " $fieldName='$fieldValue' ";
        $dataSetsArray = $this->cuSelectAsArray($tableName, $where);

        $dataSetArray = null;
        if (array_key_exists(0, $dataSetsArray)) {
            $dataSetArray = $dataSetsArray[0];
        }

        return $dataSetArray;
    }
1258008
public function field_data()
	{
		$retval = array();
		$field_data = $this->result_id->fetch_fields();
		for ($i = 0, $c = count($field_data); $i < $c; $i++)
		{
			$retval[$i]			= new stdClass();
			$retval[$i]->name		= $field_data[$i]->name;
			$retval[$i]->type		= $field_data[$i]->type;
			$retval[$i]->max_length		= $field_data[$i]->max_length;
			$retval[$i]->primary_key	= (int) ($field_data[$i]->flags & 2);
			$retval[$i]->default		= $field_data[$i]->def;
		}

		return $retval;
	}
1154755
public function getOriginalFieldData($field)
    {
        if (isset($this->originalData[ $field ])) {
            return $this->originalData[ $field ];
        }

        return null;
    }
876554
function _FetchField($fieldOffset = -1)
	{
		$fld = new ADOFieldObject;
		$fieldOffset += 1;
		$fld->name = OCIcolumnname($this->_queryID, $fieldOffset);
		if (ADODB_ASSOC_CASE == ADODB_ASSOC_CASE_LOWER) {
			$fld->name = strtolower($fld->name);
		}
		$fld->type = OCIcolumntype($this->_queryID, $fieldOffset);
		$fld->max_length = OCIcolumnsize($this->_queryID, $fieldOffset);
		if ($fld->type == 'NUMBER') {
			$sc = OCIColumnScale($this->_queryID, $fieldOffset);
			if ($sc == 0) {
				$fld->type = 'INT';
			}
		}
		return $fld;
	}
1143073
public function getFieldValue($field, $data = null)
    {
        if ($data !== null && isset($data[$field])) {
            return $data[$field];
        }
        if (isset($this->{$field})) {
            return $this->{$field};
        }
        return null;
    }
97997
protected function decorateFieldData(array $data)
    {
        $strategy = array_get($this->field->options, 'strategy');

        $data['displayStrategy'] = null;
        $data['displaySource']  = $this->field->source() ?: $this->field->key();

        if ($strategy) {

            $instance = $this->getListDisplayFactory()->make($strategy);

            // todo: resolve attribute information if we can?
            //$instance->setAttributeInformation();
            $instance->setOptions(array_get($this->field->options, 'strategy_options', []));

            $data['displayStrategy'] = $instance;
            $data['displaySource'] = array_get($this->field->options, 'strategy_source', $data['displaySource']);
        }

        return $data;
    }
384876
protected function getValuesForValidation($data = null)
  {
    $out = array();
    foreach ($this->fields as $field => $el) {
      $out[$field] = !is_null($data)
        ? isset($data[$field]) ? $data[$field] : false
        : $this->getValueFromRequest($field);
    }

    return $out;
  }
60362
protected function finalData($passedData)
    {

        $overwrittenData = $this->overwrittenData;
        $this->overwrittenData = [];

        foreach ($overwrittenData as $key=>$value) {
            $passedData[$key] = $value;
        }

        return $passedData;

    }