Generate an unique column key

@param mixed $column

@return mixed
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);
    }
280627
public function getColumnId( $column )
    {
        if ( $this->getColumnsUseTranslation() )
        {
            $translatePrefix    = $this->getColumnTranslatePrefix();
            $translatePostfix   = $this->getColumnTranslatePostfix();

            $column = ( empty( $translatePrefix )
                        ? '' : $translatePrefix . '.' ) .
                      $column .
                      ( empty( $translatePostfix )
                        ? '' : '.' . $translatePostfix );
        }

        return $column;
    }
943315
public function distinct($column = null)
    {
        if ($column) {
            $column = ['index' => $column];
        }

        $this->query = $this->query->distinct($column);

        return $this;
    }
11718
protected function prepareColumn(Column $column)
    {
        /** @var PostgresqlType $typeMapper */
        $typeMapper = $this->getDataType();

        $type = $typeMapper::getType($column->getType());

        $length = $typeMapper::noLength($type) ? null : $column->getLength();

        $column->length($length);

        if ($column->getAutoIncrement()) {
            $column->type(PostgresqlType::SERIAL);
            $options['sequences'][$column->getName()] = $this->getName() . '_' . $column->getName() . '_seq';
        }

        return parent::prepareColumn($column);
    }
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';
        }
    }
1093874
public function orWhereIsNot(string $column)
    {
        $instance = $this->whereStrategyInstance();

        $instance->whereStrategy()->orWhereIsNot($column);

        return $instance;
    }
946361
public function orderAsc(string $column)
    {
        $instance = $this->orderByStrategyInstance();

        $instance->orderByStrategy()->orderAsc($column);

        return $instance;
    }
826318
function groupBy($column) {
        if($column === null || $column === '') {
            return $this;
        }
        
        $new = array();
        foreach($this->data as $key => $val) {
            if(\is_callable($column)) {
                $key = $column($val, $key);
            } elseif(\is_array($val)) {
                $key = $val[$column];
            } elseif(\is_object($val)) {
                $key = $val->$column;
            }
            
            $new[$key][] = $val;
        }
        
        return (new self($new));
    }
697407
public function id($column = 'id')
    {
        $this->int($column)->unsigned()->autoIncrement();

        return $this->primary($column);
    }
898617
public function generateColumnFormat($column)
    {
        if ($column->phpType === 'boolean') {
            return 'boolean';
        } elseif ($column->type === 'text') {
            return 'ntext';
        } elseif (stripos($column->name, 'time') !== false && $column->phpType === 'integer') {
            return 'datetime';
        } elseif (stripos($column->name, 'email') !== false) {
            return 'email';
        } elseif (stripos($column->name, 'url') !== false) {
            return 'url';
        } else {
            return 'text';
        }
    }
801993
public function getColumnForeignKeys($column)
    {
        $matches = [];
        foreach ($this->foreignKeys as $fk) {
            if (in_array($column, $fk->getLocalColumns())) {
                $matches[] = $fk;
            }
        }

        return $matches;
    }
1114896
private static function other($column, array $unique)
    {
        $definition = '';

        // size
        if (null !== $column->scale && 0 < $column->scale) {
            $definition .= "($column->precision,$column->scale)";

        } elseif (null !== $column->size && !$column->autoIncrement && 'tinyint(1)' !== $column->dbType) {
            $definition .= "($column->size)";

        } elseif (null !== $column->size && !$column->isPrimaryKey && $column->unsigned) {
            $definition .= "($column->size)";
        }

        // unsigned
        if ($column->unsigned) {
            $definition .= '->unsigned()';
        }

        // null
        if ($column->allowNull) {
            $definition .= '->null()';

        } elseif (!$column->autoIncrement) {
            $definition .= '->notNull()';
        }

        // unique key
        if (!$column->isPrimaryKey && !empty($unique)) {
            foreach ($unique as $name) {
                if (reset($name) === $column->name) {
                    $definition .= '->unique()';
                }
            }
        }

        // default value
        if ($column->defaultValue instanceof Expression) {
            $definition .= "->defaultExpression('$column->defaultValue')";

        } elseif (is_int($column->defaultValue)) {
            $definition .= "->defaultValue($column->defaultValue)";

        } elseif (is_bool($column->defaultValue)) {
            $definition .= '->defaultValue('.var_export($column->defaultValue, true).')';

        } elseif (is_string($column->defaultValue)) {
            $definition .= "->defaultValue('".addslashes($column->defaultValue)."')";
        }

        // comment
        if (null !== $column->comment && '' !== $column->comment) {
            $definition .= "->comment('".addslashes($column->comment)."')";
        }

        // append

        return $definition;
    }
869293
public function havingIs(string $column)
    {
        $instance = $this->havingStrategyInstance();

        $instance->havingStrategy()->havingIs($column);

        return $instance;
    }
1228091
public function unique($column, $keyConstraint = '')
    {
        $alter = '';
        $alter = static::ALTER_TABLE.' `'.$this->tableName.'` ADD ';

        if (is_array($column)) {
            // build query unique key for multiple columns
            $columns = $this->commands($column);

            $this->schema = $alter.' CONSTRAINT
            UC_'.strtoupper($this->tableName).'_'.strtoupper($keyConstraint).'_ID
            '.strtoupper(__FUNCTION__).' ('.$columns.')';
        }

        if (is_string($column)) {
            $this->schema = $alter.' '.strtoupper(__FUNCTION__).' ('.$column.');';
        }

        return $this;
    }
654823
public function getLastInsertedId($column = null)
    {
        if (is_string($column)) {
            return $this->getConnection()->lastInsertId($column);
        }

        return $this->getConnection()->lastInsertId();
    }
790229
protected function duplicatesExistForColumn( $column )
	{
		$connection = $this->model->getConnection();
		$grammar = $connection->getQueryGrammar();

		$columns = array_merge( $this->model->getQualifiedScopedColumns(), [$column] );

		$columnsForSelect = implode( ', ', array_map( function ( $col ) use ( $grammar )
		{
			return $grammar->wrap( $col );
		}, $columns ) );

		$wrappedColumn = $grammar->wrap( $column );

		$query = $this->model->newQuery()->select( $connection->raw( "$columnsForSelect, COUNT($wrappedColumn)" ) )->havingRaw( "COUNT($wrappedColumn) > 1" );

		foreach ( $columns as $col )
			$query->groupBy( $col );

		$result = $query->first();

		return !is_null( $result );
	}
435376
protected function createColumn($column)
	{
		$c=new CMysqlColumnSchema;
		$c->name=$column['Field'];
		$c->rawName=$this->quoteColumnName($c->name);
		$c->allowNull=$column['Null']==='YES';
		$c->isPrimaryKey=strpos($column['Key'],'PRI')!==false;
		$c->isForeignKey=false;
		$c->init($column['Type'],$column['Default']);
		$c->autoIncrement=strpos(strtolower($column['Extra']),'auto_increment')!==false;
		if(isset($column['Comment']))
			$c->comment=$column['Comment'];

		return $c;
	}