some_field -> someField
@param string $table
@param string $column
@return string
426994
public function getEntityField($table, $column)
    {
        $class = $this->getEntityClass($table);
        /** @var Entity $entity */
        $entity = new $class;
        $reflection = $entity->getReflection($this);
        foreach ($reflection->getEntityProperties() as $property) {
            if ($property->getColumn() == $column) {
                return Utils::underscoreToCamel($property->getName());
            }
        }
        throw new InvalidArgumentException(sprintf("Could not find property for table '%s' and column '%s'", $table, $column));
    }
917197
protected static function resolve_field($field, $table) {
        $prefix = constant(__CLASS__ . '::ALIAS_' . core_text::strtoupper($table));
        return sprintf('%s.%s', $prefix, $field);
    }
246421
public function column( $column, $name = null ) 
	{
		return $this->fields( $column )->one( $name )->$column;
	}
734371
public function getRemoveColumnDDL(Column $column)
    {
        $pattern = "
ALTER TABLE %s DROP %s;
";

        return sprintf($pattern,
            $this->quoteIdentifier($column->getTable()->getName()),
            $this->quoteIdentifier($column->getName())
        );
    }
950413
public function getColumnName($column, $model = null): string
    {
        $model = $model ?? $this->model;

        return !strpos($column, '.')
            ? $this->getTableName($model) . '.' . $column
            : $column;
    }
412142
public function getColumnType($table, $column)
    {
        $table = $this->connection->getTablePrefix().$table;

        return $this->connection->getDoctrineColumn($table, $column)->getType()->getName();
    }
1241878
public function getColumnMeta($column)
    {
        try {
            return $this->_stmt->getColumnMeta($column);
        } catch (PDOException $e) {
            // require_once 'Zend/Db/Statement/Exception.php';
            throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
        }
    }
786763
public static function getEnumPairs($table, $column): array
    {
        $result = self::q_assoc_row('SHOW COLUMNS FROM `' . self::sql_prepare($table) . '` WHERE `field` = "' . self::sql_prepare($column) . '"');
        $result = str_replace(["enum('", "')", "''"], ['', '', "'"], $result['Type']);
        $result = explode("','", $result);

        $res = [];

        foreach ($result as $v) {
            $res[$v] = Converter::charsToNormalTitle($v);
        }

        return $res;
    }
851481
public function getAutoIncrementValue(string $table, string $column = 'id')
    {
        $databaseServer = $this->connection->getDatabasePlatform()->getName();
        if (isset($this->databaseSpecificHelpers[$databaseServer])) {
            return $this->databaseSpecificHelpers[$databaseServer]
                ->getAutoIncrementValue($table, $column);
        }

        return 'null';
    }
160956
protected function _getColumnKey($column)
    {
        if (!is_array($column)) {
            $matches = $this->_matchColumnString($column);
            $columnKey = $matches[1];
        } elseif (!empty($column['attribute'])) {
            $columnKey = $column['attribute'];
        } elseif (!empty($column['label'])) {
            $columnKey = $column['label'];
        } elseif (!empty($column['header'])) {
            $columnKey = $column['header'];
        } elseif (!empty($column['class'])) {
            $columnKey = $column['class'];
        } else {
            $columnKey = null;
        }
        return hash('crc32', $columnKey);
    }
190378
public static function field_exists($table, $columns, $db = null)
	{
		if ( ! is_array($columns))
		{
			$columns = array($columns);
		}

		try
		{
			\DB::select_array($columns)->from($table)->limit(1)->execute($db ? $db : static::$connection);
			return true;
		}
		catch (\Database_Exception $e)
		{
			// check if we have a DB connection at all
			$connection = \Database_Connection::instance($db ? $db : static::$connection)->has_connection();

			// if no connection could be made, re throw the exception
			if ( ! $connection)
			{
				throw $e;
			}

			return false;
		}
	}
802333
function GetFieldInfo($table, $field)
    {
        $isUnique = false;
        $isPrimary = false;
        $isNullable = false;
        $defaultValue = null;
        $fullName = '';
        if (!$this->GetBasicFieldInfo($table, $field, $fullName, $defaultValue, $isPrimary, $isUnique, $isNullable))
        {
            return null;
        }
        $typeDef = TypeDef::ParseFullName($fullName);
        if (!$typeDef)
        {
            return null;
        }
        $keyName = $this->GetKeyName($table, $field);
        if (!$keyName)
        {
            return new FieldInfo($field, $typeDef, $defaultValue, $isNullable, null, null, null);
        }
        $keyInfo = new KeyInfo($keyName, $isPrimary, $isUnique);
        $constraintName = '';
        $refTable = '';
        $refField = '';
        if (!$this->GetForeignKey($table, $field, $constraintName, $refTable, $refField))
        {
            return new FieldInfo($field, $typeDef, $defaultValue, $isNullable, $keyInfo, null, null);
        }
        
        $onUpdate = null;
        $onDelete = null;
        $this->GetConstraintRules($constraintName, $onUpdate, $onDelete);
        $foreignKey = new ForeignKey($refTable, $refField);
        $constraint = new Constraint($constraintName, $onUpdate, $onDelete);
        return new FieldInfo($field, $typeDef, $defaultValue, $isNullable, $keyInfo, $foreignKey, $constraint);
    }
539165
public function getColumnMeta($column)
	{
		$field = $this->pdo->driver->fetchField($this->resource, $column);
		$field = (array)$field;
		
		return $field;
	}
269466
private function _select($column)
    {
        if ($column === 'all' || $column == '*') {
            $this->selectColumns = $this->quoteIdentifier(
                    self::cyrus()->getTableName()
                ).'.*';
        } else {
            if (string_has($column, 'as') || string_has($column, 'AS')) {
                return $this->selectExpr($column);
            }

            $this->selectColumns = (string) str_replace(' ', '', $this->quoteIdentifier(explode(',', $column)));
        }

        return $this;
    }
1205323
protected function addColumn($key, $field, $column)
    {
        if ($this->hasCustomAttribute($column)) {
            return '->' . $field;
        }
        if ($key == 0) {
            return '->' . $field . "('" . $column . "')";
        }
        if (str_contains($field, '(')) {
            return '->' . $field;
        }

        return '->' . $field . '()';
    }
8642
private function columnName($column)
    {
        // Select all
        if ($column == '*') {
            return "`{$this->query['table']}`.*";
        }

        if (strpos($column, '.') === false) {
            $column = $this->query['table'] . ".{$column}";
        }

        // Regular column name
        if (strpos($column, '(') === false) {
            return str_replace(array('.'), array('`.`'), "`{$column}`");
        } else {
            return trim(str_replace(array('(', ')', '.'), array('(`', '`)', '`.`'), $column), '`');
        }
    }
738198
private function buildFieldMapping($tableName, Column $column)
    {
        $fieldMapping = array(
            'fieldName'  => $this->getFieldNameForColumn($tableName, $column->getName(), false),
            'columnName' => $column->getName(),
            'type'       => $column->getType()->getName(),
            'nullable'   => ( ! $column->getNotNull()),
        );

        // Type specific elements
        switch ($fieldMapping['type']) {
            case Type::TARRAY:
            case Type::BLOB:
            case Type::GUID:
            case Type::JSON_ARRAY:
            case Type::OBJECT:
            case Type::SIMPLE_ARRAY:
            case Type::STRING:
            case Type::TEXT:
                $fieldMapping['length'] = $column->getLength();
                $fieldMapping['options']['fixed']  = $column->getFixed();
                break;

            case Type::DECIMAL:
            case Type::FLOAT:
                $fieldMapping['precision'] = $column->getPrecision();
                $fieldMapping['scale']     = $column->getScale();
                break;

            case Type::INTEGER:
            case Type::BIGINT:
            case Type::SMALLINT:
                $fieldMapping['options']['unsigned'] = $column->getUnsigned();
                break;
        }

        // Comment
        if (($comment = $column->getComment()) !== null) {
            $fieldMapping['options']['comment'] = $comment;
        }

        // Default
        if (($default = $column->getDefault()) !== null) {
            $fieldMapping['options']['default'] = $default;
        }

        return $fieldMapping;
    }