@param array $column

@return array
171070
private function prepareColumn(array $column)
    {
        if ($column['sql'] instanceof self) {
            [$sql, $params] = $column['sql']->toSql();

            $column['sql'] = '(' . $sql . ')';

            $column['params'] = $params;
        }

        return $column;
    }
43887
public function column($column = null)
	{
		if($column !== null)
		{
			$this->select([$column]);
		}

		$query = $this->limit(1)->compiler->select();

		return $this->connection->column($query['sql'], $query['params']);
	}
748395
public function column($column = '*')
    {
        if ('*' == $column) {
            $this->columns = ['*'];
        } else {
            $columns = $this->prepareNames(func_get_args());
            $this->columns = array_merge(
                empty($this->columns) || ['*'] == $this->columns ? [] : $this->columns,
                array_values(array_diff($columns, ['*']))
            );
        }
        return $this;
    }
1308316
public function keyContainsValue($column)
    {
        // must use array_key_exists() because the key could
        // exist but have a NULL value (that'd be valid).
        return (array_key_exists($column, $this->map) && ($this->map[$column]->getValue() !== null));
    }
68741
private function processColumns(array $columns): array
    {
        $results = [];

        foreach ($columns as $column) {
            $types = [$column->phpType()];

            if ($column->isNullable()) {
                $types[] = 'null';
            }

            $results[$column->getName()] = $types;
        }

        return $results;
    }
723864
private function transformColumns($columns)
    {
        return array_map(function ($column) {
            return [
                'Field' => $column->Field,
                'Type' => $column->Type,
                'Null' => $column->Null,
                'Key' => $column->Key,
                'Default' => $column->Default,
                'Extra' => $column->Extra
            ];
        }, $columns);
    }
504496
protected function columnCountForWhereClause($column)
    {
        if (is_array($this->wheres))
            return count(array_filter($this->wheres, function($where) use($column) {
                return $where['column'] == $column;
            }));
    }
622684
public function get($columns = ['*'])
    {
        $original = $this->columns;

        if (is_null($original)) {
            $this->columns = $columns;
        }

        // encrypted columns replace their default (original) columns
        if ($this->encryptionModel instanceof Model
            && method_exists($this->encryptionModel, 'getEncryptKey')
        ) {
            $model = $this->encryptionModel;
            $modelEncryptionColumns = $model::getEncryptedFields();
            if (!empty($modelEncryptionColumns)) {
                if ($columns == ['*']) {
                    $this->columns = [];

                    /*
                     * Select all visible columns (avoid select *)
                     */
                    $visibles = array_diff(array_merge($model->getFillable(), $model->getGuarded()), $model->getHidden());
                    $unencryptedVisibles = array_unique(array_diff($visibles, array_column($this->encryptionColumns, 'column')));
                    sort($unencryptedVisibles);

                    $primaryKey = [
                        $model->getKeyName()
                    ];

                    $attributes = array_merge($primaryKey, $unencryptedVisibles);

                    if ($model->usesTimestamps()) {
                        $attributes[] = $model->getCreatedAtColumn();
                        $attributes[] = $model->getUpdatedAtColumn();
                    }

                    // add all visible unencrypted columns
                    foreach ($attributes as $attribute) {
                        $this->columns[] = $attribute;
                    }

                    // add all encrypted columns
                    $this->columns = array_merge($this->columns, array_column($this->encryptionColumns, 'select'));
                } else {
                    $this->columns = [];

                    // add all visible unencrypted columns
                    $encryptionColumnNames = array_column($this->encryptionColumns, 'column');
                    foreach ($columns as $column) {
                        if (!in_array($column, $encryptionColumnNames)) {
                            $this->columns[] = $column;
                        }
                    }
                    // add the encrypted columns (and decrypted, if 'withDecryptionKey' was given)
                    foreach ($this->encryptionColumns as $encryptionColumn){
                        if (in_array($encryptionColumn['column'], $columns)) {
                            $this->columns[] = $encryptionColumn['select'];
                        }
                    }
                }
            }
        }

        $results = $this->processor->processSelect($this, $this->runSelect());

        $this->columns = $original;

        return collect($results);
    }
1251887
public function hideColumn($column)
    {
        if (! is_array($column))
            $column = [$column];

        $newColumn = [];
        foreach ($this->column as $item) {
            if (is_array($item)) {
                $new = array_values(array_diff($item, $column));
                if (! empty($new))
                    $newColumn[] = count($new) > 1
                        ? array_values($new)
                        : $new[0];
            }
            else if (! in_array($item, $column))
                $newColumn[] = $item;

        }
        $this->column = $newColumn;

        return $this;
    }
872940
public function getColumnMeta($column)
    {
        $fields = sqlsrv_field_metadata($this->_stmt);

        if (!$fields) {
            throw new Zend_Db_Statement_Sqlsrv_Exception('Column metadata can not be fetched');
        }

        if (!isset($fields[$column])) {
            throw new Zend_Db_Statement_Sqlsrv_Exception('Column index does not exist in statement');
        }

        return $fields[$column];
    }
757561
public function value($column)
    {
        $result = (array) $this->first([$column]);

        return count($result) > 0 ? reset($result) : null;
    }
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;
    }
1104309
public function values($column) {
		$res = [];
		while($row = $this->next())
			$res[] = $row[$column];
		return $res;
	}
542487
protected function _initColumn($column)
    {
        $defaults = [
            'type'  => 'string',
            'array' => false
        ];
        if (is_string($column)) {
            $column = ['type' => $column];
        } elseif (isset($column[0])) {
            $column['type'] = $column[0];
            unset($column[0]);
        }
        $column += $defaults;
        return $column + ['null' => false];
    }
98430
protected function getColumnPhpType($column)
    {
        static $typeMap = [ // abstract type => php type
            'smallint' => 'integer',
            'integer' => 'integer',
            'bigint' => 'integer',
            'timestamp' => 'integer',
            'boolean' => 'boolean',
            'float' => 'double',
        ];
        if (isset($typeMap[$column->type])) {
            if ($column->type === 'bigint') {
                return PHP_INT_SIZE == 8 ? 'integer' : 'string';
            } elseif ($column->type === 'integer' || $column->type === 'timestamp') {
                return PHP_INT_SIZE == 4 ? 'string' : 'integer';
            } else {
                return $typeMap[$column->type];
            }
        } else {
            return 'string';
        }
    }
1312716
protected function getSelectColumns(array $columns = ['*'])
    {
        if ($columns == ['*']) {
            $columns = [$this->relatedMap->getTable().'.*'];
        }

        return array_merge($columns, [$this->parentMap->getTable().'.'.$this->firstKey]);
    }
1252156
public function columns($columns = [])
    {
        if (func_num_args() == 0) {
            return $this->columns;
        }

        if (func_num_args() == 1 && is_array($columns)) {
            foreach ($columns as $column => $label) {
                $this->column($column, $label);
            }

            return;
        }

        foreach (func_get_args() as $column) {
            $this->column($column);
        }
    }