return the SqlColumn object related to that column name
@param string $strColumnName Name of the column
@return SqlColumn
339351
public function getColumnByName($strColumnName) {
		if ($this->objColumnArray) {
			foreach ($this->objColumnArray as $objColumn){
				if ($objColumn->Name == $strColumnName)
					return $objColumn;
			}
		}
		return null;
	}
712625
protected function getColumnIndex($field, string $error_message)
    {
        $method = is_string($field) ? 'getColumnIndexByValue' : 'getColumnIndexByKey';

        return $this->$method($field, $error_message);
    }
1212132
public function getColumn($strColumnName, $strColumnType = null)
    {
        if (!isset($this->strColumnArray[$strColumnName])) {
            return null;
        }
        $strColumnValue = $this->strColumnArray[$strColumnName];
        switch ($strColumnType) {
            case FieldType::BIT:
                // PostgreSQL returns 't' or 'f' for boolean fields
                if ($strColumnValue == 'f') {
                    return false;
                } else {
                    return ($strColumnValue) ? true : false;
                }

            case FieldType::BLOB:
            case FieldType::CHAR:
            case FieldType::VAR_CHAR:
            case FieldType::JSON: // JSON is basically String
                return Type::cast($strColumnValue, Type::STRING);
            case FieldType::DATE:
            case FieldType::DATE_TIME:
            case FieldType::TIME:
                return new QDateTime($strColumnValue);

            case FieldType::FLOAT:
                return Type::cast($strColumnValue, Type::FLOAT);

            case FieldType::INTEGER:
                return Type::cast($strColumnValue, Type::INTEGER);

            default:
                return $strColumnValue;
        }
    }
976615
public function createQueryColumn(
        $query_name = "",
        $table_name = "table_name",
        $column_name = "column_name",
        $column_type = "string",
        $column_length = 0,
        $column_mask = "MASK",
        $in_select = true
    ) {
        // Default Query Column Name to Datbase Column Name ( if not set )

        $this->columns[] = new QueryColumn
        (
            $query_name,
            $table_name,
            $column_name,
            $column_type,
            $column_length,
            $column_mask,
            $in_select
        );
        end($this->columns);
        $ky = key($this->columns);
        $this->display_order_set["itemno"][] = count($this->columns);
        $this->display_order_set["column"][] = &$this->columns[$ky];
    }
133098
protected function getColumnSqlDefinition(Column $column)
    {
        if ($column->getType() instanceof Literal) {
            $def = (string)$column->getType();
        } else {
            $sqlType = $this->getSqlType($column->getType(), $column->getLimit());
            $def = strtoupper($sqlType['name']);
        }
        if ($column->getPrecision() && $column->getScale()) {
            $def .= '(' . $column->getPrecision() . ',' . $column->getScale() . ')';
        } elseif (isset($sqlType['limit'])) {
            $def .= '(' . $sqlType['limit'] . ')';
        }
        if (($values = $column->getValues()) && is_array($values)) {
            $def .= "('" . implode("', '", $values) . "')";
        }
        $def .= $column->getEncoding() ? ' CHARACTER SET ' . $column->getEncoding() : '';
        $def .= $column->getCollation() ? ' COLLATE ' . $column->getCollation() : '';
        $def .= (!$column->isSigned() && isset($this->signedColumnTypes[$column->getType()])) ? ' unsigned' : '';
        $def .= ($column->isNull() == false) ? ' NOT NULL' : ' NULL';
        $def .= $column->isIdentity() ? ' AUTO_INCREMENT' : '';
        $def .= $this->getDefaultValueDefinition($column->getDefault(), $column->getType());

        if ($column->getComment()) {
            $def .= ' COMMENT ' . $this->getConnection()->quote($column->getComment());
        }

        if ($column->getUpdate()) {
            $def .= ' ON UPDATE ' . $column->getUpdate();
        }

        return $def;
    }
575157
public String getColumnName(final int column) throws SQLException {
    String columnName = getColumnInformation(column).getOriginalName();
    if (returnTableAlias) {
      columnName = getColumnInformation(column).getName(); //for old mysql compatibility
    }

    if ("".equals(columnName)) {
      // odd things that are no columns, e.g count(*)
      columnName = getColumnLabel(column);
    }
    return columnName;
  }
1268264
protected function getPhinxColumnType(array $columnData): string
    {
        $columnType = $columnData['COLUMN_TYPE'];
        if ($columnType == 'tinyint(1)') {
            return 'boolean';
        }
        $map = [
            'tinyint' => 'integer',
            'smallint' => 'integer',
            'int' => 'integer',
            'mediumint' => 'integer',
            'bigint' => 'biginteger',
            'tinytext' => 'text',
            'mediumtext' => 'text',
            'longtext' => 'text',
            'varchar' => 'string',
            'tinyblob' => 'blob',
            'mediumblob' => 'blob',
            'longblob' => 'blob',
        ];

        $type = $this->getMySQLColumnType($columnData);
        if (isset($map[$type])) {
            $type = $map[$type];
        }

        return $type;
    }
281826
protected function getColumnCommentSqlDefinition(Column $column, $tableName)
    {
        // passing 'null' is to remove column comment
        $currentComment = $this->getColumnComment($tableName, $column->getName());

        $comment = (strcasecmp($column->getComment(), 'NULL') !== 0) ? $this->getConnection()->quote($column->getComment()) : '\'\'';
        $command = $currentComment === false ? 'sp_addextendedproperty' : 'sp_updateextendedproperty';

        return sprintf(
            "EXECUTE %s N'MS_Description', N%s, N'SCHEMA', N'%s', N'TABLE', N'%s', N'COLUMN', N'%s';",
            $command,
            $comment,
            $this->schema,
            $tableName,
            $column->getName()
        );
    }
122585
public function getAssocColumn($table, $columnName, $defaultValue = null)
    {
        $values = [];
        foreach ($table as $key => $line) {
            if (array_key_exists($columnName, $line)) {
                $values[$key] = $line[$columnName];
            } else {
                $values[$key] = $defaultValue;
            }
        }

        return $values;
    }
950413
public function getColumnName($column, $model = null): string
    {
        $model = $model ?? $this->model;

        return !strpos($column, '.')
            ? $this->getTableName($model) . '.' . $column
            : $column;
    }
1115585
public function getTitleColumnName()
    {
        // If we specified a specific fieldname or array of fieldnames as 'title'.
        if (!empty($this->contenttype['title_format'])) {
            return (array) $this->contenttype['title_format'];
        }

        // Sets the names of some 'common' names for the 'title' column.
        $names = ['title', 'name', 'caption', 'subject', 'heading'];

        // Some localised options as well
        $names = array_merge($names, ['titel', 'naam', 'onderwerp']); // NL
        $names = array_merge($names, ['nom', 'sujet']); // FR
        $names = array_merge($names, ['nombre', 'sujeto']); // ES

        foreach ($names as $name) {
            if (isset($this->values[$name])) {
                return [$name];
            }
        }

        // Otherwise, grab the first field of type 'text', and assume that's the title.
        if (!empty($this->contenttype['fields'])) {
            foreach ($this->contenttype['fields'] as $key => $field) {
                if ($field['type'] === 'text') {
                    return [$key];
                }
            }
        }

        // Nope, no title was found.
        return [];
    }
664088
public function createStringColumn(string $name, int $length, string $charset = null): StringColumn {
		$column = new CommonStringColumn($name, $length, $charset);
		$this->table->addColumn($column);
		return $column;
	}
920258
public function getCellDataForColumnName($columnName)
    {
        return Extractor::extract(
            $this->_data,
            $this->_dataGrid->getColumn($columnName)->getCellAccessor()
        );
    }
585445
@Override
    public ColumnRealName toColumnRealName(String columnDbName) {
        return ColumnRealName.create(xgetAliasName(), toColumnSqlName(columnDbName));
    }
190509
private function getColumnsString()
    {
        if (count($this->columns) === 1 && $this->columns[0] === '*') {
            return '*';
        }
        $columns = array_map(function ($column) {
            return (strpos($column, '.') === false)? $this->table . '.' . $column : $column;
        }, $this->columns);
        return implode(', ', $columns);
    }
1090254
protected function calculateObjectDescription($strTableName, $strColumnName, $strReferencedTableName, $blnPluralize)
    {
        // Strip Prefixes (if applicable)
        $strTableName = $this->stripPrefixFromTable($strTableName);
        $strReferencedTableName = $this->stripPrefixFromTable($strReferencedTableName);

        // Starting Point
        $strToReturn = QString::camelCaseFromUnderscore($strTableName);

        if ($blnPluralize) {
            $strToReturn = $this->pluralize($strToReturn);
        }

        if ($strTableName == $strReferencedTableName) {
            // Self-referencing Reference to Describe

            // If Column Name is only the name of the referenced table, or the name of the referenced table with "_id",
            // then the object description is simply based off the table name.
            if (($strColumnName == $strReferencedTableName) ||
                ($strColumnName == $strReferencedTableName . '_id')
            ) {
                return sprintf('Child%s', $strToReturn);
            }

            // Rip out trailing "_id" if applicable
            $intLength = strlen($strColumnName);
            if (($intLength > 3) && (substr($strColumnName, $intLength - 3) == "_id")) {
                $strColumnName = substr($strColumnName, 0, $intLength - 3);
            }

            // Rip out the referenced table name from the column name
            $strColumnName = str_replace($strReferencedTableName, "", $strColumnName);

            // Change any double "_" to single "_"
            $strColumnName = str_replace("__", "_", $strColumnName);
            $strColumnName = str_replace("__", "_", $strColumnName);

            $strColumnName = QString::camelCaseFromUnderscore($strColumnName);

            // Special case for Parent/Child
            if ($strColumnName == 'Parent') {
                return sprintf('Child%s', $strToReturn);
            }

            return sprintf("%sAs%s",
                $strToReturn, $strColumnName);

        } else {
            // If Column Name is only the name of the referenced table, or the name of the referenced table with "_id",
            // then the object description is simply based off the table name.
            if (($strColumnName == $strReferencedTableName) ||
                ($strColumnName == $strReferencedTableName . '_id')
            ) {
                return $strToReturn;
            }

            // Rip out trailing "_id" if applicable
            $intLength = strlen($strColumnName);
            if (($intLength > 3) && (substr($strColumnName, $intLength - 3) == "_id")) {
                $strColumnName = substr($strColumnName, 0, $intLength - 3);
            }

            // Rip out the referenced table name from the column name
            $strColumnName = str_replace($strReferencedTableName, "", $strColumnName);

            // Change any double "_" to single "_"
            $strColumnName = str_replace("__", "_", $strColumnName);
            $strColumnName = str_replace("__", "_", $strColumnName);

            return sprintf("%sAs%s",
                $strToReturn,
                QString::camelCaseFromUnderscore($strColumnName));
        }
    }
298731
protected function getSelectColumnsSQL()
    {
        // Create the column list fragment only once
        if ($this->currentPersisterContext->selectColumnListSql !== null) {
            return $this->currentPersisterContext->selectColumnListSql;
        }

        $columnList         = array();
        $discrColumn        = $this->class->discriminatorColumn['name'];
        $baseTableAlias     = $this->getSQLTableAlias($this->class->name);
        $resultColumnName   = $this->platform->getSQLResultCasing($discrColumn);

        $this->currentPersisterContext->rsm->addEntityResult($this->class->name, 'r');
        $this->currentPersisterContext->rsm->setDiscriminatorColumn('r', $resultColumnName);
        $this->currentPersisterContext->rsm->addMetaResult('r', $resultColumnName, $discrColumn);

        // Add regular columns
        foreach ($this->class->fieldMappings as $fieldName => $mapping) {
            $class = isset($mapping['inherited'])
                ? $this->em->getClassMetadata($mapping['inherited'])
                : $this->class;

            $columnList[] = $this->getSelectColumnSQL($fieldName, $class);
        }

        // Add foreign key columns
        foreach ($this->class->associationMappings as $mapping) {
            if ( ! $mapping['isOwningSide'] || ! ($mapping['type'] & ClassMetadata::TO_ONE)) {
                continue;
            }

            $tableAlias = isset($mapping['inherited'])
                ? $this->getSQLTableAlias($mapping['inherited'])
                : $baseTableAlias;

            foreach ($mapping['targetToSourceKeyColumns'] as $srcColumn) {
                $className = isset($mapping['inherited'])
                    ? $mapping['inherited']
                    : $this->class->name;

                $targetClass = $this->em->getClassMetadata($mapping['targetEntity']);

                $columnList[] = $this->getSelectJoinColumnSQL(
                    $tableAlias,
                    $srcColumn,
                    $className,
                    PersisterHelper::getTypeOfColumn(
                        $mapping['sourceToTargetKeyColumns'][$srcColumn],
                        $targetClass,
                        $this->em
                    )
                );
            }
        }

        // Add discriminator column (DO NOT ALIAS, see AbstractEntityInheritancePersister#processSQLResult).
        $tableAlias = ($this->class->rootEntityName == $this->class->name)
            ? $baseTableAlias
            : $this->getSQLTableAlias($this->class->rootEntityName);

        $columnList[] = $tableAlias . '.' . $discrColumn;

        // sub tables
        foreach ($this->class->subClasses as $subClassName) {
            $subClass   = $this->em->getClassMetadata($subClassName);
            $tableAlias = $this->getSQLTableAlias($subClassName);

            // Add subclass columns
            foreach ($subClass->fieldMappings as $fieldName => $mapping) {
                if (isset($mapping['inherited'])) {
                    continue;
                }

                $columnList[] = $this->getSelectColumnSQL($fieldName, $subClass);
            }

            // Add join columns (foreign keys)
            foreach ($subClass->associationMappings as $mapping) {
                if ( ! $mapping['isOwningSide']
                        || ! ($mapping['type'] & ClassMetadata::TO_ONE)
                        || isset($mapping['inherited'])) {
                    continue;
                }

                foreach ($mapping['targetToSourceKeyColumns'] as $srcColumn) {
                    $className = isset($mapping['inherited'])
                        ? $mapping['inherited']
                        : $subClass->name;

                    $targetClass = $this->em->getClassMetadata($mapping['targetEntity']);

                    $columnList[] = $this->getSelectJoinColumnSQL(
                        $tableAlias,
                        $srcColumn,
                        $className,
                        PersisterHelper::getTypeOfColumn(
                            $mapping['sourceToTargetKeyColumns'][$srcColumn],
                            $targetClass,
                            $this->em
                        )
                    );
                }
            }
        }

        $this->currentPersisterContext->selectColumnListSql = implode(', ', $columnList);

        return $this->currentPersisterContext->selectColumnListSql;
    }