Format the name of a field.

@param string $field The field name to format.
@return string Returns the formatted field name.
347999
protected function formatFieldName(string $field): string {
        if ($this->getTranslateFieldNames()) {
            return $this->translate($field);
        } else {
            return $field;
        }
    }
13931
private static function getFieldNameArray($fields)
    {
        if (count($fields) === 0) {
            return;
        }

        $names = array();

        foreach ($fields as &$field) {
            $names[] = $field->name;
        }

        return $names;
    }
1355663
protected function computeHydrateFieldName($field)
    {
        if ($this->hasNamingStrategy()) {
            $field = $this->getNamingStrategy()->hydrate($field);
        }
        return $field;
    }
714998
public static function quoteField($field) {
        $trimmedField = trim($field);
        if ($trimmedField == '*') {
            return $trimmedField;
        }

        if (strpos($trimmedField, ' ') !== false) {
            return $trimmedField;
        }

        return strpos($trimmedField, '.') !== false ?
                $trimmedField : "`{$trimmedField}`";
    }
1339932
public function getField(string $field) : string
        {
                $value = $this->_redis->hget($this->_key, $field);
                return empty($value) ? '' : strval($value);
        }
103201
protected function parseField($fields)
    {
        if(!isset($fields[0]))
        {
            return '*';
        }
        $result = [];
        foreach($fields as $k => $v)
        {
            if(is_numeric($k))
            {
                if($v instanceof Field)
                {
                    $field = $v;
                }
                else
                {
                    $field = new Field;
                    $field->setValue($v);
                }
            }
            else
            {
                $field = new Field(null, null, $k, $v);
            }
            $result[] = $field;
        }
        return implode(',', $result);
    }
473606
public function getField($field)
    {
        $result = array_filter($this->getFields(), function($input) use ($field) {
            return $field === $input->getName();
        });

        return reset($result);
    }
46846
protected function get_field($field) {
        $fieldname = calculator::using_attempts_string_id($this->whichattempts).$field;
        return $this->{$fieldname};
    }
554151
private function mapFieldName($fieldName)
    {
        if (isset($this->fieldNameMapping[$fieldName])) {
            $fieldName = $this->fieldNameMapping[$fieldName];
        }

        return $fieldName;
    }
71618
public static function fieldListToValuesString($fields)
    {
        $formattedFields = [];
        foreach ($fields as $field) {
            $fieldWithColonPrefix = ':' . $field;
            $formattedFields[] = $fieldWithColonPrefix;
        }

        return ' value (' . implode(', ', $formattedFields) . ')';
    }
1252629
public function punctuation($field)
    {
        return (preg_match("/[^\w\s\p{P}]/", '' . $this->get($field)) > 0) ? $this->error($field, __FUNCTION__) : true;
    }
1068834
public function getUploadFieldName($field = null)
    {
        if (!is_null($field)) {
            return $field;
        }

        $imagesFields = $this->getDefinedUploadFields();
        $fieldKey = array_first(array_keys($imagesFields));

        // return first field name
        return is_int($fieldKey)
            ? $imagesFields[$fieldKey]
            : $fieldKey;
    }
260264
public static function formatter(Field $field)
    {
        $result = '';
        $options = [];

        if (!empty($field->metadata->settings['options'])) {
            foreach (explode("\n", $field->metadata->settings['options']) as $option) {
                $option = explode('|', $option);
                $value = $option[0];
                $label = isset($option[1]) ? $option[1] : $option[0];
                $options[$value] = $label;
            }
        }

        if (is_string($field->extra)) {
            $selectedOptions = [$field->extra];
        } else {
            $selectedOptions = (array)$field->extra;
        }

        foreach ($selectedOptions as $key) {
            switch ($field->viewModeSettings['formatter']) {
                case 'key':
                    $result .= "{$key}<br />";
                    break;

                case 'default':
                default:
                    if (!empty($options[$key])) {
                        $result .= "{$options[$key]}<br />";
                    }
                    break;
            }
        }

        return $result;
    }
263841
public function field_format_value($fields, $data) 
    {
        if (!$fields || !$data || !is_array($data)) {
            return $data;
        }
        foreach ($fields as $field) {
            $obj = $this->get($field['fieldtype']);
            if (!$obj) {
                continue;
            }
            if ($field['fieldtype'] === 'Group') {
                continue;
            }
            $data = $obj->output_data($data, $field);
        }
        return $data;
    }
945676
public function getUpdateSqlFieldName($field)
    {
        $lang = $this->getLanguage();
        if ($lang && $this->_blEmployMultilanguage && $this->isMultilingualField($field)) {
            $field .= "_" . $lang;
        }

        return $field;
    }
480980
public function addField($fieldName, Field $field)
    {
        $this->fieldNames[ $fieldName ] = $fieldName;
        $this->fields[ $fieldName ]     = $field;

        return $fieldName;
    }
20073
private function formatFieldName($key)
    {
        $related_model = $this->revisionable_type;
        $related_model = new $related_model;
        $revisionFormattedFieldNames = $related_model->getRevisionFormattedFieldNames();

        if (isset($revisionFormattedFieldNames[$key])) {
            return $revisionFormattedFieldNames[$key];
        }

        return false;
    }