Returns the position of one field in the array.
@param string $fieldname
@return int|null index of the field, or null if not found.
196908
public function findFieldInArray($fieldname) {
        foreach ($this->fields as $i => $field) {
            if ($fieldname == $field->getName()) {
                return $i;
            }
        }
        return null;
    }
654580
function errors($fieldname) {
		if ($fieldname == null) {
			return null;
		}
		else { # field errors
			if ($this->errors !== null) {
				if (isset($this->errors[$fieldname])) {
					return $this->errors[$fieldname];
				}
				else { # not set
					return null;
				}
			}
		}
	}
722751
public function cuGetFieldInfo($tableName, $fieldName)
    {

        /** @noinspection SqlNoDataSourceInspection */
        $query  = 'SELECT `%s` FROM `%s`;';
        $query  = sprintf($query, $fieldName, $tableName);
        $result = $this->query($query);

        return $result->fetch_field_direct(0);
    }
835107
public function getWhereParametersFor($fieldName)
    {
        return array_intersect_key(
            $this->getWhereParameters(),
            array_flip(preg_grep('/^' . $fieldName . '_\d+$/', array_keys($this->getWhereParameters())))
        );
    }
895095
public function getField($fieldName) {
        if(empty($fieldName)) {
            throw new \InvalidArgumentException('Please provide a fieldname');
        }
        
        $values = array();
        foreach($this->fields as $field) {
            if($field['name'] == $fieldName) {
                $values[] = $field['value'];
            }
        }
        
        return $values;
    }
1159365
function &fieldNamed($fieldName)
    {
        $return = NULL;
        if (isset($this->_fields[$fieldName])) {
            $return =& $this->_fields[$fieldName];
        }

        return $return;
    }
417110
public function getFieldByName($name)
    {
        foreach ($this->fields as $field) {
            if ($field->getName() == $name) {
                return $field;
            }
        }

        return null;
    }
364327
protected function getColumnPosition(string $fieldName): int
    {
        $position = array_search($fieldName, self::COLUMN_POSITIONS, true);
        return is_int($position) ? $position : PHP_INT_MAX;
    }
1367981
public function getFieldIndex($name)
    {
        foreach ($this->getFields() as $index => $field) {
            if ($field->getName() === $name) {
                return $index;
            }
        }

        throw new FieldNotFoundException("Field `{$name}` not found.");
    }
112337
public function getGetter($fieldName)
    {
        if ($this->hasField($fieldName) === false)
        {
            return false;
        }
        return $this->mapping[$fieldName]['getter'];
    }
1177653
public function exclude($fieldName = null)
    {
        if ( ! isset($this->query['select'])) {
            $this->query['select'] = array();
        }

        $fieldNames = is_array($fieldName) ? $fieldName : func_get_args();

        foreach ($fieldNames as $fieldName) {
            $this->query['select'][$fieldName] = 0;
        }

        return $this;
    }
1225023
public function getFormatter($fieldName)
    {
        if ($this->hasField($fieldName) === false) {
            return null;
        }

        return $this->mapping[$fieldName]['formatter'];
    }
532616
public function getHighlight(string $fieldName): ? string
    {
        return isset($this->highlights[$fieldName])
            ? ((string) $this->highlights[$fieldName])
            : null;
    }
1120503
public function getFieldName(int $fieldNum): string
    {
        if (0 > $fieldNum || $this->getFieldCount() <= $fieldNum) {
            throw new \Error(\sprintf('No field with index %d in result', $fieldNum));
        }

        return \pg_field_name($this->handle, $fieldNum);
    }
850783
private function getOldFieldName($modelName, $fieldName)
    {
        $modelRenamedFields = ArrayHelper::getValue(
            $this->renamedFields,
            $modelName,
            []
        );
        if ($modelRenamedFields) {
            $fieldName = ArrayHelper::getValue(
                $modelRenamedFields,
                $fieldName,
                $fieldName
            );
        }

        return $fieldName;
    }
770983
public function getFilter(string $fieldName): ?Condition
    {
        [$name, $filters] = $this->getArrayAndKeyName($fieldName, 'filters');

        return array_first($filters, function ($filter) use ($name) {
            return $filter->getName() === $name;
        });
    }
1224592
public static function getFieldKey($fieldName, $fieldId)
    {
        if (isset(get_field_objects($fieldId)[$fieldName]['key'])) {
            return get_field_objects($fieldId)[$fieldName]['key'];
        }

        return false;
    }