Returns the SQL that converts a timestamp value to a unix timestamp.

@param string $column
@return string
973362
public function unixTimestamp( $column )
    {
        $column = $this->getIdentifier( $column );

        if ( $column != 'NOW()' )
        {
            $column = "CAST( {$column} AS TIMESTAMP )";
//            // alternative
//            if ( preg_match( '/[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/', $column ) ) {
//                $column = "TO_TIMESTAMP( {$column}, 'YYYY-MM-DD HH24:MI:SS' )";
//            }
        }

        $date1 = "CAST( SYS_EXTRACT_UTC( {$column} ) AS DATE )";
        $date2 = "TO_DATE( '19700101000000', 'YYYYMMDDHH24MISS' )";
        return " ROUND( ( {$date1} - {$date2} ) / ( 1 / 86400 ) ) ";
    }
1361105
public function quote($value, string $column = ''): string {
        if ($value instanceof Literal) {
            /* @var Literal $value */
            return $value->getValue($this, $column);
        } elseif (in_array(gettype($value), ['integer', 'double'])) {
            return (string)$value;
        } elseif ($value instanceof \DateTimeInterface) {
            $value = $value->format(\DateTime::RFC3339);
        } elseif ($value === true) {
            return '1';
        } elseif ($value === false) {
            return '0';
        }

        return $this->getPDO()->quote($value);
    }
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';
        }
    }
1035458
public function columnSql($column, $platform)
    {
        if ($this->_length <= 255) {
            return $platform->columnSql($column, "varchar({$this->_length})", $this->options());
        } elseif ($this->_length <= 65534) {
            return $platform->columnSql($column, "text", $this->options());
        } elseif ($this->_length <= 16777214) {
            return $platform->columnSql($column, "mediumtext", $this->options());
        } elseif ($this->_length <= 4294967294) {
            return $platform->columnSql($column, "longtext", $this->options());
        } else {
            throw new \BadMethodCallException("Unhandled string length of {$this->_length}");
        }
    }
209189
private static function data_type($column){
        /** @var $wpdb \wpdb */
        global $wpdb;
        // Let's create query
        $sql = $column['type'];
        // Is DECIMAL?
        if( self::DECIMAL == $column['type'] ){
            $sql .= sprintf('(%d, %d)', $column['max_digit'], $column['float']);
        }
        // Add length
        if( isset($column['length']) ){
            $sql .= sprintf('(%d)', $column['length']);
        }
        // Is enum or set?
        if( self::is_set($column['type']) ){
            $values = [];
            foreach($column['values'] as $val){
                $values[] = $wpdb->prepare('%s', $val);
            }
            $sql .= sprintf('(%s)', implode(', ', $values));
        }
        // Is unsigned?
        if( self::is_numeric($column['type']) && isset($column['signed']) && !$column['signed'] ){
            $sql .= ' UNSIGNED';
        }
        // Is not null?
        if( !$column['null'] ){
            $sql .= ' NOT NULL';
        }
        // Is auto increment?
        if( isset($column['auto_increment']) && $column['auto_increment'] ){
            $sql .= ' AUTO_INCREMENT';
        }
        // Is primary key?
        if( isset($column['primary']) && $column['primary'] ){
            $sql .= ' PRIMARY KEY';
        }
        // Has default?
        if( isset($column['default']) ){
            if( self::is_numeric($column['default']) ){
                $repl = ' DEFAULT '.$column['default'];
            }else{
	            switch( $column['default'] ){
		            case 'CURRENT_TIMESTAMP':
						// Without replace
						$sql .= " DEFAULT {$column['default']}";
			            break;
		            default:
						// Replace
		                $sql .= $wpdb->prepare(' DEFAULT %s', $column['default']);
			            break;
	            }
            }
        }
        return $sql;
    }
848153
public function getFormattedValue(AbstractColumn $column)
    {
        $row = $this->getRowData();
        $value = $row[$column->getUniqueId()];

        if ('' == $value) {
            return $value;
        }

        $index = 0;
        while ($value >= 1024 && $index < count(self::$prefixes)) {
            $value = $value / 1024;
            ++$index;
        }

        return sprintf('%1.2f %sB', $value, self::$prefixes[$index]);
    }
947840
public function getColumn(string $column)
    {
        return isset($this->columnData[$column]) ? $this->columnData[$column] : null;
    }
10280
protected function parseColumn($column) {
		if ($column instanceof Column) {
			$type = $column->getType();
			return empty($type) ? $column->getName() : $column->getName() . ':' . $type;
		}
		
		return $column;
	}
343317
public function whereIsNull(string $column)
    {
        $instance = $this->whereStrategyInstance();

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

        return $instance;
    }
940546
public function getValue(string $column)
    {
        if ($column === 'id') return $this->id;
        return $this->data[$column]->getValue();
    }
557000
protected function usingTextToNumeric($column, $type)
    {
        $type = strtolower($type);

        $details = $this->getColumnDetail($column);

        list($originType) = explode('(', $details->Type);

        $textTypes = [
            PostgresqlType::TEXT,
            PostgresqlType::CHAR,
            PostgresqlType::CHARACTER,
            PostgresqlType::VARCHAR,
        ];

        $numericTypes = [
            PostgresqlType::INTEGER,
            PostgresqlType::SMALLINT,
            PostgresqlType::FLOAT,
            PostgresqlType::DOUBLE,
            PostgresqlType::DECIMAL,
        ];

        if (in_array($originType, $textTypes, true) && in_array($type, $numericTypes, true)) {
            return sprintf('USING trim(%s)::%s', $this->db->quoteName($column), $type);
        }

        return null;
    }
1103882
protected function quoteColumn($column)
    {
        if (($pos = strpos($column, '.')) !== false) {
            return $this->db->quoteName(substr($column, 0, $pos)) . '.' . $this->db->quoteName(substr($column, $pos + 1));
        }

        return $this->db->quoteName($column);
    }
86118
protected function getTemporalFormatter(Column $col)
    {
        $fmt = null;
        if ($col->getType() === PropelTypes::DATE) {
            $fmt = $this->getPlatform()->getDateFormatter();
        } elseif ($col->getType() === PropelTypes::TIME) {
            $fmt = $this->getPlatform()->getTimeFormatter();
        } elseif ($col->getType() === PropelTypes::TIMESTAMP) {
            $fmt = $this->getPlatform()->getTimestampFormatter();
        }

        return $fmt;
    }
669957
final public function getFieldType(string $table, string $column): string
    {
        /* @noinspection PhpUnhandledExceptionInspection */
        return $this->getColumnsMetadata($table)['fieldTypes'][$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']);
	}
369846
public function getColumn($column) {
		if ($this->columns->has($column)) {
			return $this->columns[$column];
		}

		throw new ColumnException('Column not found!');
	}
412067
protected function getColumnSqlDefinition(Column $column)
    {
        $sqlType = $this->getSqlType($column->getType());
        $def = '';
        $def .= strtoupper($sqlType['name']);
        if ($column->getPrecision() && $column->getScale()) {
            $def .= '(' . $column->getPrecision() . ',' . $column->getScale() . ')';
        }
        $limitable = in_array(strtoupper($sqlType['name']), $this->definitionsWithLimits);
        if (($column->getLimit() || isset($sqlType['limit'])) && $limitable) {
            $def .= '(' . ($column->getLimit() ?: $sqlType['limit']) . ')';
        }
        if (($values = $column->getValues()) && is_array($values)) {
            $def .= " CHECK({$column->getName()} IN ('" . implode("', '", $values) . "'))";
        }

        $default = $column->getDefault();

        $def .= ($column->isNull() || is_null($default)) ? ' NULL' : ' NOT NULL';
        $def .= $this->getDefaultValueDefinition($default);
        $def .= ($column->isIdentity()) ? ' PRIMARY KEY AUTOINCREMENT' : '';

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

        $def .= $this->getCommentDefinition($column);

        return $def;
    }