@param string $field

@return array
550246
private function mapToRelationshipAndAttribute(string $field): array
    {
        $rootSchema = $this->getRootSchema();
        if ($rootSchema->hasAttributeMapping($field) === true) {
            $relationship = null;
            $schema       = $rootSchema;
            $attribute    = new Attribute($field, $schema);

            return [$relationship, $attribute];
        } elseif ($rootSchema->hasRelationshipMapping($field) === true) {
            $fromSchema   = $rootSchema;
            $toSchema     = $this->getJsonSchemas()->getRelationshipSchema(get_class($fromSchema), $field);
            $relationship = new Relationship($field, $fromSchema, $toSchema);
            $attribute    = new Attribute($toSchema::RESOURCE_ID, $toSchema);

            return [$relationship, $attribute];
        } elseif (count($mightBeRelAndAttr = explode('.', $field, 2)) === 2) {
            // Last chance. It could be a dot ('.') separated relationship with an attribute.

            $mightBeRel  = $mightBeRelAndAttr[0];
            $mightBeAttr = $mightBeRelAndAttr[1];

            $fromSchema = $rootSchema;
            if ($fromSchema->hasRelationshipMapping($mightBeRel)) {
                $toSchema = $this->getJsonSchemas()->getRelationshipSchema(get_class($fromSchema), $mightBeRel);
                if ($toSchema::hasAttributeMapping($mightBeAttr) === true) {
                    $relationship = new Relationship($mightBeRel, $fromSchema, $toSchema);
                    $attribute    = new Attribute($mightBeAttr, $toSchema);

                    return [$relationship, $attribute];
                }
            }
        }

        $error = $this->createQueryError($field, static::MSG_ERR_INVALID_FIELD);
        throw new InvalidQueryParametersException($error);
    }
628636
public function getFieldType($field)
    {
        $definition = $this->getFieldDefinition($field);
        if ($definition && isset($definition['type'])) {
            return $definition['type'];
        }
    }
1350883
public function getFieldType($field)
    {
        return isset($this->getFieldsConfig()[$field]) ? $this->getFieldsConfig()[$field]['type'] : null;
    }
1357191
protected function flattenCollection($field)
    {
        if (!isset($field['fields']) || !is_array($field['fields'])) {
            return [];
        }

        $fields = [];

        foreach ($field['fields'] as $field) {
            if (isset($field['fields']) && is_array($field['fields'])) {
                $fields += $this->flattenCollection($field);
            } else {
                $fields[$field['name']] = $field;
            }
        }

        return $fields;
    }
645935
private function parseSegments($field)
    {
        $segments = explode(':', $field);

        $name = array_shift($segments);
        $argument = $segments[0];

        return compact('name', 'argument');

    }
473606
public function getField($field)
    {
        $result = array_filter($this->getFields(), function($input) use ($field) {
            return $field === $input->getName();
        });

        return reset($result);
    }
1335807
private function getFieldValue($field)
    {
        return isset($this->values[$field]) ? $this->values[$field] : null;
    }
420231
private function getFieldData($field)
    {
        if (!isset($this->_fieldData[$field])) {
            foreach ($this->fields as $f) {
                if (($f['key'] === $field) || ($f['name'] === $field)) {
                    $this->_fieldData[$field] = $f;
                    break;
                }
            }
        }

        if (isset($this->_fieldData[$field])) {
            return $this->_fieldData[$field];
        } else {
            throw new Exception("Field $field does not exist");
        }
    }
512597
public function error($field)
    {
        $parts = explode('.', $field);
        $entity = $this->entity($parts);

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

        return [];
    }
968148
public function order($field) {
        $order = [];
        if (is_array($field)) {
            foreach ($field as $key => $value) {
                $order[] = $key . ' ' . $value;
            }
        } else {
            $order = func_get_args();
        }
        $order = implode(',', $order);
        $this->order = !empty($order) ? ' ORDER BY ' . $order : '';
        return $this;
    }
1053971
public function values($field)
    {
        $values = [];
        foreach ($this->distinct()->select([$field])->all() as $v) {
            $values[] = $v[$field];
        }

        return $values;
    }
366608
private function getOrderClause(string $field) : array
    {
        $className = App::shortName(get_class($this->table), 'Model/Table', 'Table');
        $config = (new ModuleConfig(ConfigType::FIELDS(), $className))->parse();

        if (! property_exists($config, $field)) {
            return [];
        }

        if (! property_exists($config->{$field}, 'orderBy')) {
            return [];
        }

        if (! property_exists($config->{$field}, 'orderDir')) {
            return [];
        }

        return [$config->{$field}->orderBy => $config->{$field}->orderDir];
    }
457929
public function findColumn($field) {
        $rows = $this->select($field)->findAll();

        //false or null
        if (!$rows) {
            return $rows;
        }

        $columnValues = [];
        foreach ($rows as $row) {
            $columnValues[] = $row[$field];
        }
        return $columnValues;
    }
1273537
protected function splitRelationField($field)
    {
        $parts = explode(':', $field);
        $partsCount = count($parts);

        return [implode('.', array_slice($parts, 0, $partsCount - 1)), $parts[$partsCount - 1]];
    }
6350
public function rules($field)
    {
        return (isset($this->data[$field]) && $validate = $this->data[$field]['validate']) ? $validate : array();
    }
50461
public function getFieldDefinition($field)
    {
        if (isset($this->definition[$field])) {
            return $this->definition[$field];
        }
        if (isset($this->definition['fields'][$field])) {
            return $this->definition['fields'][$field];
        }
        return null;
    }
238549
protected function _splitFieldname($field) {
		$regex = '/^([a-z0-9_-]+)\.([a-z 0-9_-]+|\*)$/iS';

		if (strpos($field, '.') !== false && preg_match($regex, $field, $matches)) {
			return [$matches[1], $matches[2]];
		}
		return [null, $field];
	}