Returns the position of the field called name within the record, or -1 if
it cannot be found. Field names are not case-sensitive. If more than one
field matches, the first one is returned.

@param string $name
@return int
334225
public function getIndexOf(string $name): int
    {
        if (array_key_exists($name, $this->record) == false) {
            return -1;
        }

        $keyArray = array_keys($this->record);

        return array_search($name, $keyArray);
    }
858673
public function field($name)
  {
    return isset($this->fields[$name]) ? $this->fields[$name] : false;
  }
908697
public static function sortByField(string $name, int $orientation = 1, ?Closure $next = null) : Closure
    {
        if (! $next) {
            $next = static function () : int {
                return 0;
            };
        }

        return static function ($a, $b) use ($name, $next, $orientation) : int {
            $aValue = ClosureExpressionVisitor::getObjectFieldValue($a, $name);

            $bValue = ClosureExpressionVisitor::getObjectFieldValue($b, $name);

            if ($aValue === $bValue) {
                return $next($a, $b);
            }

            return ($aValue > $bValue ? 1 : -1) * $orientation;
        };
    }
256285
public function getCleanedFieldAsInt(string $field_name): int
    {
        if (empty($this->initial_data[$field_name])) {
            return 0;
        }

        if (!is_scalar($this->initial_data[$field_name])) {
            return 0;
        }

        return (int)$this->initial_data[$field_name];
    }
11956
public function getFieldType($name)
    {
        return $this->checkFieldExist($name)->types[$name] != null
            ? rtrim($this->types[$name], '[]')
            : null;
    }
417110
public function getFieldByName($name)
    {
        foreach ($this->fields as $field) {
            if ($field->getName() == $name) {
                return $field;
            }
        }

        return null;
    }
1346128
private function getAttributeIndex(string $name): ?int
    {
        $indexes = $this->getSerializer()::readRulesIndexes($this->getAttributeRules());
        $index   = $indexes[$name] ?? null;

        return $index;
    }
1075763
public function getIntValue($name):?int
    {
        $value = $this->offsetGet($name);
        if (is_null($value)) {
            return null;
        }

        return (int)$value;
    }
121010
public function getField($name)
    {
        if ($this->has($name)) {
            return $this->fields[$name];
        }

        $this->fieldDoesNotExist($name);
    }
770482
public function getLookup($name)
    {
        if (array_key_exists($name, self::$lookups)) {
            return self::$lookups[$name];
        }

        throw new FieldError(sprintf('Lookup %s is not recognized', $name));
    }
1262023
public int getFieldIndex(String name) {
		Integer val = this.nameToIndex.get(name);
		if (val == null) {
			return -1;
		}
		return val;
	}
712455
public function getFieldFromHierarchy($name)
    {
        return !is_null($this->owner->$name) ? $this->owner->$name : $this->owner->getFieldFromParent($name);
    }
543265
public function getOriginalFieldValue($name)
    {
        if ($this->isFieldModified($name)) {
            return $this->fieldsModified[$name];
        }

        if (isset($this->data['fields'][$name])) {
            return $this->data['fields'][$name];
        }

        return null;
    }
1107091
public function getField($name)
    {
        $f = $this->hasField($name);

        if ($f === false) {
            throw new Exception(['Field is not defined in model', 'model' => get_class($this), 'field' => $name]);
        }

        return $f;
    }
941043
function Field($name)
    {
        if (!array_key_exists($name, $this->fields))
            throw new \InvalidArgumentException($name . ' is not a valid field for '. $this->name);
        
        return $this->fields[$name];
    }
1219794
public function lastIndexByName($name) {
        for ($i = count($this->tokens) - 1; $i >= 0; $i--) {
            if ($this->tokens[$i]->getName() === $name) {
                return $i;
            }
        }

        return null;
    }
48926
protected function _getField($name)
    {
        return isset( $this->_response[$name] ) ? $this->_response[$name] : null;
    }