Get the errors for a specific field.

@param string $field The full path to the field.
@return array Returns an array of errors.
487129
public function getFieldErrors(string $field): array {
        if (empty($this->errors[$field])) {
            return [];
        } else {
            $result = [];
            foreach ($this->errors[$field] as $error) {
                $result[] = $this->pluckError($error + ['field' => $field]);
            }
            return $result;
        }
    }
429153
public function getField($field)
    {
        return isset($this->data[$field])
            ? $this->data[$field]
            : $this->searchField($field);
    }
562226
protected function getField($field)
    {
        if ($this->isFieldSupported($field) && isset($this->fields[ $field ])) {
            return $this->fields[ $field ];
        }

        return null;
    }
481014
public function error($field)
    {
        return ($this->submitted && isset($this->errors[$field])) ? $this->errors[$field] : null;
    }
1350883
public function getFieldType($field)
    {
        return isset($this->getFieldsConfig()[$field]) ? $this->getFieldsConfig()[$field]['type'] : null;
    }
15614
public function errors($field = null)
    {
        if ($field !== null) {
            return isset($this->_errors[$field]) ? $this->_errors[$field] : false;
        }

        return $this->_errors;
    }
238420
public function getFiltersForField(string $field): array
    {
        $filters = [];
        foreach ($this->filters as $filter) {
            if ($field === $filter->getField()) {
                $filters[] = $filter;
            }
        }

        return $filters;
    }
1287623
protected function get($field)
    {
        if (isset($this->raw[$field])) {
            return $this->raw[$field];
        }
        if (preg_match('/^is_/', $field)) {
            return false;
        }

        return null;
    }
46846
protected function get_field($field) {
        $fieldname = calculator::using_attempts_string_id($this->whichattempts).$field;
        return $this->{$fieldname};
    }
163812
public function value($field)
    {
        if (is_array($field)) {
            $values = array();
            foreach ($field as $key => $value) {
                $values[$key] = $this->value($value);
            }

            return $values;
        }

        return ($this->submitted && isset($this->values[$field])) ? $this->values[$field] : null;
    }
579696
public function getInvalidField($field)
    {
        $value = isset($this->_invalid[$field]) ? $this->_invalid[$field] : null;

        return $value;
    }
472901
public function offsetGet($field) {
        if (isset($this->values[$field]) || $this->load($field)) {
            return $this->values[$field];
        }

        return NULL;
    }
14687
public function getErrors(): array {
        $result = [];
        foreach ($this->getRawErrors() as $field => $error) {
            $result[] = $this->pluckError(['field' => $field] + $error);
        }
        return $result;
    }
540510
public static function getField($field)
    {
        return isset(self::$fields[$field]) ? self::$fields[$field] : null;
    }
1510
protected function _nestedErrors($field)
    {
        $path = explode('.', $field);

        // Only one path element, check for nested entity with error.
        if (count($path) === 1) {
            return $this->_readError($this->get($path[0]));
        }

        $entity = $this;
        $len = count($path);
        while ($len) {
            $part = array_shift($path);
            $len = count($path);
            $val = null;
            if ($entity instanceof EntityInterface) {
                $val = $entity->get($part);
            } elseif (is_array($entity)) {
                $val = isset($entity[$part]) ? $entity[$part] : false;
            }

            if (is_array($val) ||
                $val instanceof Traversable ||
                $val instanceof EntityInterface
            ) {
                $entity = $val;
            } else {
                $path[] = $part;
                break;
            }
        }
        if (count($path) <= 1) {
            return $this->_readError($entity, array_pop($path));
        }

        return [];
    }
376780
public function getValidation($field = null)
    {

        $validation = array();
        $schema = $this->getModelSchema();

        if ($field != null)
            $schema = array($field => $schema[$field]);

        foreach ( $schema as $key => $value ) {
            if (!isset($value['validation']))
                throw new Exception('Validation missing for key: '.$field);
            $validation[$key] = $value['validation'];
        }

        if ($field != null)
            return $validation[$field];

        return $validation;
    }
189617
protected static function filter($field)
    {
        $field = preg_replace('/[\.\/\\:;,?$*!#_-]/', '', $field);
        $field = preg_replace('/\s+/', ' ', trim($field));
        return $field;
    }