@param IField $field

@return ColumnComponentType
193503
public static function forField(IField $field) : ColumnComponentType
    {
        return new self(
                $field->getProcessedType(),
                StandardConditions::forField($field, $field->getProcessedType()->getConditionOperators())
        );
    }
1297352
public function groupBy($field)
    {
        $field = $this->addTablePrefix($field);
        $this->addStatement('groupBys', $field);
        return $this;
    }
1354147
public function components(array $components) : IColumn
    {
        foreach ($components as $key => $component) {
            if ($component instanceof IColumnComponent) {

            } elseif ($component instanceof IField) {
                $component = ColumnComponent::forField($component);
            } elseif ($component instanceof FieldBuilderBase) {
                $component = ColumnComponent::forField($component->build());
            } else {
                throw TypeMismatchException::format(
                        'Invalid array passed to %s: expecting elements to be instance of %s, %s found',
                        __METHOD__, IColumnComponent::class . '|' . IField::class . '|' . FieldBuilderBase::class, Debug::getType($component)
                );
            }

            $components[$key] = $component;
        }

        $this->components = $components;

        return $this->build();
    }
130025
private function getSelectConditionStatementColumnSQL($field, $assoc = null)
    {
        if (isset($this->class->columnNames[$field])) {
            $className = (isset($this->class->fieldMappings[$field]['inherited']))
                ? $this->class->fieldMappings[$field]['inherited']
                : $this->class->name;

            return array($this->getSQLTableAlias($className) . '.' . $this->quoteStrategy->getColumnName($field, $this->class, $this->platform));
        }

        if (isset($this->class->associationMappings[$field])) {
            $association = $this->class->associationMappings[$field];
            // Many-To-Many requires join table check for joinColumn
            $columns = array();
            $class   = $this->class;

            if ($association['type'] === ClassMetadata::MANY_TO_MANY) {
                if ( ! $association['isOwningSide']) {
                    $association = $assoc;
                }

                $joinTableName = $this->quoteStrategy->getJoinTableName($association, $class, $this->platform);
                $joinColumns   = $assoc['isOwningSide']
                    ? $association['joinTable']['joinColumns']
                    : $association['joinTable']['inverseJoinColumns'];


                foreach ($joinColumns as $joinColumn) {
                    $columns[] = $joinTableName . '.' . $this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform);
                }

            } else {

                if ( ! $association['isOwningSide']) {
                    throw ORMException::invalidFindByInverseAssociation($this->class->name, $field);
                }

                $className  = (isset($association['inherited']))
                    ? $association['inherited']
                    : $this->class->name;

                foreach ($association['joinColumns'] as $joinColumn) {
                    $columns[] = $this->getSQLTableAlias($className) . '.' . $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform);
                }
            }
            return $columns;
        }

        if ($assoc !== null && strpos($field, " ") === false && strpos($field, "(") === false) {
            // very careless developers could potentially open up this normally hidden api for userland attacks,
            // therefore checking for spaces and function calls which are not allowed.

            // found a join column condition, not really a "field"
            return array($field);
        }

        throw ORMException::unrecognizedField($field);
    }
530686
private function getCommonType($columnName, $field)
    {
        static $types = [
            SQLITE3_INTEGER => CommonTypes::TINT,
            SQLITE3_FLOAT => CommonTypes::TNUMBER,
            SQLITE3_TEXT => CommonTypes::TTEXT,
            // static::SQLITE3_BLOB => CommonTypes::TTEXT,
            // static::SQLITE3_NULL => CommonTypes::TTEXT,
        ];
        if (isset($this->overrideTypes[$columnName])) {
            return $this->overrideTypes[$columnName];
        }
        if (false !== $field && array_key_exists($field, $types)) {
            return $types[$field];
        }
        return CommonTypes::TTEXT;
    }
628636
public function getFieldType($field)
    {
        $definition = $this->getFieldDefinition($field);
        if ($definition && isset($definition['type'])) {
            return $definition['type'];
        }
    }
1241612
public function addColumn( $type, $column, $field ) {
		$table = $type;
		$type = $field;
		$table = $this->safeTable($table);
		$column = $this->safeColumn($column);
		$type = array_key_exists($type, $this->typeno_sqltype) ? $this->typeno_sqltype[$type] : '';
		$sql = "ALTER TABLE $table ADD COLUMN $column $type ";
		$this->adapter->exec( $sql );
	}
1067494
private function removeColumn(PropertyField $field)
    {
        $source = $this->targetModel()->source();

        $sql = strtr(
            'ALTER TABLE `%table` DROP COLUMN `%key`',
            [
                '%table' => $source->table(),
                '%key'   => $field->ident(),
            ]
        );
        $source->db()->query($sql);

        return $this;
    }
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;
    }
908980
public function getJsonFieldType($field)
    {
        return isset($this->options['field_type'][$field]) ? $this->options['field_type'][$field] : null;
    }
2248
private function addColumn($field, $type = "migration", $meta = "")
    {


        if ($type == 'migration') {

            $syntax = sprintf("\$table->%s('%s')", $field['type'], $field['name']);

            // If there are arguments for the schema type, like decimal('amount', 5, 2)
            // then we have to remember to work those in.
            if ($field['arguments']) {
                $syntax = substr($syntax, 0, -1) . ', ';

                $syntax .= implode(', ', $field['arguments']) . ')';
            }

            foreach ($field['options'] as $method => $value) {
                $syntax .= sprintf("->%s(%s)", $method, $value === true ? '' : $value);
            }

            $syntax .= ';';


        } elseif ($type == 'view-index-header') {

            // Fields to index view
            $syntax = sprintf("<th>%s", strtoupper($field['name']));
            $syntax .= '</th>';

        } elseif ($type == 'view-index-content') {

            // Fields to index view
            $syntax = sprintf("<td>{{\$%s->%s", $meta['var_name'], strtolower($field['name']));
            $syntax .= '}}</td>';

        } elseif ($type == 'view-show-content') {

            // Fields to show view
            $syntax = sprintf("<div class=\"form-group\">\n" .
                str_repeat(' ', 21) . "<label for=\"%s\">%s</label>\n" .
                str_repeat(' ', 21) . "<p class=\"form-control-static\">{{\$%s->%s}}</p>\n" .
                str_repeat(' ', 16) . "</div>", strtolower($field['name']), strtoupper($field['name']), $meta['var_name'], strtolower($field['name']));


        } elseif ($type == 'view-edit-content') {
            $syntax = $this->buildField($field, $type, $meta['var_name']);
        } elseif ($type == 'view-create-content') {
            $syntax = $this->buildField($field, $type, $meta['var_name'], false);
        } else {
            // Fields to controller
            $syntax = sprintf("\$%s->%s = \$request->input(\"%s", $meta['var_name'], $field['name'], $field['name']);
            $syntax .= '");';
        }


        return $syntax;
    }
882915
private function addField(array $properties, FieldInterface $field)
    {
        $fieldName = $field->getName();
        $fieldRoot = &$properties;

        // Read property config from the field.
        $property = $field->getMappingPropertyConfig();

        $fieldPathArray   = explode('.', $fieldName);
        $currentPathArray = [];
        $fieldPathSize    = count($fieldPathArray);

        for ($i = 0; $i < $fieldPathSize - 1; $i++) {
            $currentPathArray[] = $fieldPathArray[$i];
            $currentPath        = implode('.', $currentPathArray);

            if ($field->isNested() && $field->getNestedPath() == $currentPath && !isset($fieldRoot[$fieldPathArray[$i]])) {
                $fieldRoot[$fieldPathArray[$i]] = ['type' => FieldInterface::FIELD_TYPE_NESTED, 'properties' => []];
            } elseif (!isset($fieldRoot[$fieldPathArray[$i]])) {
                $fieldRoot[$fieldPathArray[$i]] = ['type' => FieldInterface::FIELD_TYPE_OBJECT, 'properties' => []];
            }

            $fieldRoot = &$fieldRoot[$fieldPathArray[$i]]['properties'];
        }

        /*
         * Retrieving location where the property has to be copied to.
         * Ex : searchable fields are copied to default "search" field.
         */
        $copyToProperties = $this->getFieldCopyToProperties($field);

        if (!empty($copyToProperties)) {
            // For normal fields, copy_to is append at the property root.
            $copyToRoot = &$property;
            $copyToRoot['copy_to'] = $copyToProperties;
        }

        $fieldRoot[end($fieldPathArray)] = $property;

        return $properties;
    }
394272
public function getFieldType($field) {
    try {
      $key = $this->getKey($field);
      
      // dies kann auch einen verschachtelten Array von Types zurück geben, wenn der Schlüssel den man angibt noch Untertypen hat
      return $this->types->get($key, DataInput::THROW_EXCEPTION, DataInput::THROW_EXCEPTION);
    
    } catch (\Psc\DataInputException $e) {
      $e = new FieldNotDefinedException(sprintf("Feld mit den Schluessel(n) '%s' ist nicht in Meta definiert. Vorhanden sind (Ebenen durch . getrennt): %s",
                                                $key, implode(', ', $avFields = $this->getKeys())),
                                        0, $e);
      $e->field = explode(':',$key); // expand
      $e->avaibleFields = $avFields;
      throw $e;
    }
  }
895387
private static function createDatabaseFields($table, $field, $slug, $isCreate = true)
    {
        // insert column only if it is not already in the DB
        if ($isCreate || (isset($field['canBeRemoved']) && $field['canBeRemoved'])) {
            // if field is translatable
            if($field['translatable']) {
                $table->json($slug)->nullable();
            }else{
                if($field['type']['inputType'] == "text" || $field['type']['inputType'] == "email" || $field['type']['inputType'] == "checkbox" || $field['type']['inputType'] == "radio") {
                    $table->string($slug)->nullable();
                }else if ($field['type']['inputType'] == "textarea" || $field['type']['inputType'] == "dropdown" || $field['type']['inputType'] == "editor") {
                    $table->text($slug)->nullable();
                }else if ($field['type']['inputType'] == "number") {
                    $table->integer($slug)->nullable();
                }else if ($field['type']['inputType'] == "date") {
                    $table->dateTime($slug)->nullable();
                }else if ($field['type']['inputType'] == "boolean") {
                    $table->tinyInteger($slug)->nullable();
                }else if ($field['type']['inputType'] == "db") {
                    if($field['isMultiple']) {
                        $table->json($slug)->nullable();
                    }else{
                        $table->integer($slug)->nullable();
                    }
                }
            }
        }
    }
1317937
protected function getFieldType(CustomField $field)
    {
        $type  = explode(':', $field->type);
        $where = ['name' => head($type)];
        if (count($type) > 1) {
            $where['type'] = last($type);
        }
        return FieldType::query()->where($where)->firstOrFail(['id']);
    }
1353591
public function findWhereIn($field, array $values, $columns = ['*'])
    {
        return parent::findWhereIn(
            $this->getColumnName($field),
            $values,
            $this->getColumnsNames($columns)
        );
    }
1124332
public function importField($field)
    {
        $field = $this->model->hasElement($field);
        /** @type \atk4\data\Field $field */

        if (!$field || !$field->isVisible() || $field->isHidden()) {
            return;
        }

        $field_name = $field->short_name;
        $field_type = $this->getFieldType($field);
        $field_caption = isset($field->ui['caption']) ? $field->ui['caption'] : null;

        $this->field_associations[$field_name] = $field;

        $column = $this->owner->addColumn($field_type, $field_name, $field_caption);

        if (isset($field->ui['sortable']) && $field->ui['sortable'] && $column->hasMethod('makeSortable')) {
            $column->makeSortable();
        }

        return $column;
    }