com\setasign\SetaFramework\Database\Manager\Column

Binary Class Binary

File: /SetaFramework/src/Database/Manager/Column/Binary.php

Class hierarchy

Summary

Constants

DEFAULT_CURRENT_TIMESTAMP

public const AbstractColumn::DEFAULT_CURRENT_TIMESTAMP = 'current_timestamp()'

DEFAULT_NULL

public const AbstractColumn::DEFAULT_NULL = 'NULL'

Properties

$allowNull

protected bool AbstractColumn::$allowNull = false

$columnName

protected string AbstractColumn::$columnName

$default

protected mixed AbstractColumn::$default

$indexes

protected array AbstractColumn::$indexes = array()

$length

protected ?int AbstractLengthColumn::$length

$oldColumnName

protected ?string AbstractColumn::$oldColumnName

Methods

__construct()

public AbstractLengthColumn::__construct (
string $columnName,
?int $length = null
)
Parameters
$columnName : string
 
$length : ?int
 

addIndex()

Parameters
$type : string
 
$indexName : ?string
 

addPrimaryKey()

addUnique()

public AbstractColumn::addUnique (
?string $indexName = null
): $this
Parameters
$indexName : ?string
 

changeDataType()

Change the dataType of a column (with all possible attributes)

Parameters
$newColumnObject : AbstractColumn
 

copy()

This method clones this object, removes the tableSchema and returns the clone.

getDefault()

public AbstractColumn::getDefault (
void
): mixed

getIndexes()

public AbstractColumn::getIndexes (
void
): array

getLength()

public AbstractLengthColumn::getLength (
void
): ?int

getName()

public AbstractColumn::getName (
void
): string

getOldColumnName()

public AbstractColumn::getOldColumnName (
void
): ?string

hasChanged()

public AbstractLengthColumn::hasChanged (
AbstractColumn $compareColumn,
bool $compareDataType = true,
bool $compareName = true
): bool

Checks whether this column is the same as $compareColumn.

Parameters
$compareColumn : AbstractColumn
 
$compareDataType : bool

Check whether both dataTypes are equal.

$compareName : bool

Check whether both columnNames are equal.

isAllowedNull()

public AbstractColumn::isAllowedNull (
void
): bool

removeAllIndexes()

removeIndex()

public AbstractColumn::removeIndex (
?string $indexName = null
): $this
Parameters
$indexName : ?string
 

rename()

public AbstractColumn::rename (
string $newName
): $this
Parameters
$newName : string
 
Exceptions

Throws \com\setasign\SetaFramework\Exception

setAllowNull()

public AbstractColumn::setAllowNull (
bool $allowNull = true
): $this
Parameters
$allowNull : bool
 

setDefault()

public AbstractColumn::setDefault (
null|string|int $default
): $this
Parameters
$default : null|string|int
 

setLength()

public AbstractLengthColumn::setLength (
?int $length
): $this
Parameters
$length : ?int
 

setOldColumnName()

public AbstractColumn::setOldColumnName (
string $oldColumnName
): $this

Used for TableSchemaBuilder. Will be ignored for hasChanged

Parameters
$oldColumnName : string