@param string $field

@return array

@throws \Exception
496094
public function analyseField($field)
    {
        try {
            $accessor = PropertyAccess::createPropertyAccessor();

            $data = $accessor->getValue($this, $field);
        } catch (\Exception $exc) {
            throw new \Exception("Property $field does not exist for " . get_class());
        }

        return SearchAnalyser::analyse($data);
    }
512597
public function error($field)
    {
        $parts = explode('.', $field);
        $entity = $this->entity($parts);

        if ($entity instanceof EntityInterface) {
            return $entity->getError(array_pop($parts));
        }

        return [];
    }
429153
public function getField($field)
    {
        return isset($this->data[$field])
            ? $this->data[$field]
            : $this->searchField($field);
    }
1186509
public function messages($field)
    {
        return (isset($this->data[$field]) && $messages = $this->data[$field]['messages']) ? $messages : array();
    }
238420
public function getFiltersForField(string $field): array
    {
        $filters = [];
        foreach ($this->filters as $filter) {
            if ($field === $filter->getField()) {
                $filters[] = $filter;
            }
        }

        return $filters;
    }
680965
public function parseFields($fields)
    {
        switch (true) {
            case is_array($fields):
                $fields = array_values($fields);
                break;
            case is_string($fields):
                $fields = preg_split('/\s*,\s*/', trim($fields), -1, PREG_SPLIT_NO_EMPTY);
                break;
            default:
                throw new QueryException('', QueryException::SELECT_NOT_PARSE);
                break;
        }
        return $fields ? $fields :[];
    }
325394
public function getFieldErrors($field) {
		$existing = array_key_get($this->errors['fields'], $field['options']['name']);
		if (!empty($existing)) {
			$result = [
				'type' => null,
				'message' => '',
				'counters' => []
			];
			$sorted = [
				'danger' => [],
				'warning' => [],
				'success' => [],
				'info' => []
			];
			$types = array_keys($existing);
			if (in_array('danger', $types)) {
				$result['type'] = 'danger';
			} else {
				$temp = current($types);
				$result['type'] = $temp;
			}
			// generating text messages
			foreach ($existing as $k => $v) {
				foreach ($v as $k2 => $v2) {
					$result['counters'][$k] = ($result[$k] ?? 0) + 1;
					$sorted[$k][$k2] = $v2;
				}
			}
			foreach ($sorted as $k => $v) {
				if (empty($v)) continue;
				foreach ($v as $k2 => $v2) {
					$result['message'].= \HTML::text(['tag' => 'div', 'class' => 'numbers_field_error_messages', 'data-field_value_hash' => $k2, 'type' => $k, 'value' => $v2]);
				}
			}
			return $result;
		}
		return null;
	}
780922
protected function getEnumParams(Field $field)
    {
        if ($field->getEloquentDataMethod() != 'enum') {
            throw new Exception('The field type is not enum! Cannot create an enum column with no options.');
        }

        $labels = array_filter($field->getOptionsByLang(), function ($option) use ($field) {
            return !($field->isRequired() && $option->value == '');
        });

        $values = $this->getLabelValues($labels);

        if (count($values) == 0) {
            throw new Exception('Could not find any option values to construct the enum values from. ' .
                'It is possible that this field is required but only have option available has an empty string.');
        }

        return sprintf('[%s]', implode(',', Helpers::wrapItems($values)));
    }
81091
public function lists($field) {
        $result = $this->field($field)->get();
        $data   = [];
        if (!empty($result)) {
            $field = explode(',', $field);
            switch (count($field)) {
            case 1:
                foreach ($result as $row) {
                    $data[] = $row[$field[0]];
                }
                break;
            case 2:
                foreach ($result as $v) {
                    $data[$v[$field[0]]] = $v[$field[1]];
                }
                break;
            default:
                foreach ($result as $v) {
                    $data[$v[$field[0]]] = $v;
                }
                break;
            }

            return $data;
        }

        return [];
    }
74263
public function getContent(string $field)
    {
        return Arr::get($this->toArray(), $field) ?? Arr::get($this->getRelations(), $field);
    }
75444
protected function addField(Field $field)
    {
        if ($this->hasField($field->getName())) {
            throw new \Exception(
                'Field already defined for name: ' . $field->getName()
            );
        }

        $index = count($this->fields);

        $this->fieldsNameIndex[$index] = $field->getName();
        $this->fields[] = $field;
    }
399591
public function to($field)
    {
        if ($field instanceof FieldBuilderBase) {
            $field = $field->build();
        }

        call_user_func($this->callback, $field);

        return $field;
    }
729870
public function expressionForField($field)
    {
        return isset($this->select[$field]) ? $this->select[$field] : null;
    }
241436
public function getField($field)
    {
        return $this->getFields()->filter(function($input) use ($field) {
            return $field === $input->getName();
        })->first();
    }
709325
public function values($field)
    {
        $source = $this->getSource();
        if ($pos = strpos($source, '.')) {
            $db = substr($source, 0, $source);
            $collection = substr($source, $pos + 1);
        } else {
            $db = null;
            $collection = $source;
        }

        $mongodb = $this->getConnection();

        $cmd = ['distinct' => $collection, 'key' => $field];
        if ($this->_filters) {
            $filters = [];
            foreach ($this->_filters as $filter) {
                $key = key($filter);
                $value = current($filter);
                if (isset($filters[$key]) || count($filter) !== 1) {
                    $filters = ['$and' => $this->_filters];
                    break;
                }
                $filters[$key] = $value;
            }
            $cmd['query'] = $filters;
        }

        $r = $mongodb->command($cmd, $db)[0];
        if (!$r['ok']) {
            throw new InvalidFormatException([
                '`:distinct` distinct for `:collection` collection failed `:code`: `:msg`',
                'distinct' => $field,
                'code' => $r['code'],
                'msg' => $r['errmsg'],
                'collection' => $source
            ]);
        }

        return $this->_limit ? array_slice($r['values'], $this->_offset, $this->_limit) : $r['values'];
    }
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;
        }
    }
1087475
public function translateFieldParams(array $field) : array
    {

        $keys = array('prepend', 'append', 'placeholder', 'default_value');

        foreach ($keys as $key) {
            if (!isset($field[$key])) {
                continue;
            }

            $field[$key] = acf_translate($field[$key]);
        }

        if (isset($field['sub_fields']) && is_array($field['sub_fields'])) {
            foreach ($field['sub_fields'] as &$subfield) {
                if (function_exists('\acf_translate_field')) {
                    $subfield = \acf_translate_field($subfield);
                }
            }
        }

        return $field;
    }