class Column extends AbstractAsset (View source)

Object representation of a database column

Properties

protected string $_name from AbstractAsset
protected $_quoted from AbstractAsset
protected Type $_type
protected int $_length
protected int $_precision
protected int $_scale
protected bool $_unsigned
protected bool $_fixed
protected bool $_notnull
protected string $_default
protected bool $_autoincrement
protected array $_platformOptions
protected string $_columnDefinition
protected string $_comment

Methods

_setName(string $name)

Set name of this asset

bool
isQuoted(string $identifier)

Check if this identifier is quoted.

string
trimQuotes(string $identifier)

Trim quotes from the identifier.

string
getName()

Return name of this schema asset.

string
getQuotedName(AbstractPlatform $platform)

Get the quoted representation of this asset but only if it was defined with one. Otherwise return the plain unquoted value as inserted.

string
_generateIdentifierName(array $columnNames, string $prefix = '', int $maxSize = 30)

Generate an identifier from a list of column names obeying a certain string length.

__construct($columnName, Type $type, array $options = array())

Create a new Column

setOptions(array $options)

No description

setType(Type $type)

No description

setLength(int $length)

No description

setPrecision(int $precision)

No description

setScale(int $scale)

No description

setUnsigned(bool $unsigned)

No description

setFixed(bool $fixed)

No description

setNotnull(bool $notnull)

No description

setDefault(mixed $default)

No description

setPlatformOptions(array $platformOptions)

No description

setPlatformOption(string $name, mixed $value)

No description

setColumnDefinition(string $value)

No description

getType()

No description

getLength()

No description

getPrecision()

No description

getScale()

No description

getUnsigned()

No description

getFixed()

No description

getNotnull()

No description

getDefault()

No description

getPlatformOptions()

No description

hasPlatformOption($name)

No description

getPlatformOption($name)

No description

getColumnDefinition()

No description

getAutoincrement()

No description

setAutoincrement($flag)

No description

setComment($comment)

No description

getComment()

No description

visit(Visitor $visitor)

No description

array
toArray()

No description

Details

protected _setName(string $name)

Set name of this asset

Parameters

string $name

protected bool isQuoted(string $identifier)

Check if this identifier is quoted.

Parameters

string $identifier

Return Value

bool

protected string trimQuotes(string $identifier)

Trim quotes from the identifier.

Parameters

string $identifier

Return Value

string

string getName()

Return name of this schema asset.

Return Value

string

string getQuotedName(AbstractPlatform $platform)

Get the quoted representation of this asset but only if it was defined with one. Otherwise return the plain unquoted value as inserted.

Parameters

AbstractPlatform $platform

Return Value

string

protected string _generateIdentifierName(array $columnNames, string $prefix = '', int $maxSize = 30)

Generate an identifier from a list of column names obeying a certain string length.

This is especially important for Oracle, since it does not allow identifiers larger than 30 chars, however building idents automatically for foreign keys, composite keys or such can easily create very long names.

Parameters

array $columnNames
string $prefix
int $maxSize

Return Value

string

__construct($columnName, Type $type, array $options = array())

Create a new Column

Parameters

$columnName
Type $type
array $options

Column setOptions(array $options)

Parameters

array $options

Return Value

Column

Column setType(Type $type)

Parameters

Type $type

Return Value

Column

Column setLength(int $length)

Parameters

int $length

Return Value

Column

Column setPrecision(int $precision)

Parameters

int $precision

Return Value

Column

Column setScale(int $scale)

Parameters

int $scale

Return Value

Column

Column setUnsigned(bool $unsigned)

Parameters

bool $unsigned

Return Value

Column

Column setFixed(bool $fixed)

Parameters

bool $fixed

Return Value

Column

Column setNotnull(bool $notnull)

Parameters

bool $notnull

Return Value

Column

Column setDefault(mixed $default)

Parameters

mixed $default

Return Value

Column

Column setPlatformOptions(array $platformOptions)

Parameters

array $platformOptions

Return Value

Column

Column setPlatformOption(string $name, mixed $value)

Parameters

string $name
mixed $value

Return Value

Column

Column setColumnDefinition(string $value)

Parameters

string $value

Return Value

Column

getType()

getLength()

getPrecision()

getScale()

getUnsigned()

getFixed()

getNotnull()

getDefault()

getPlatformOptions()

hasPlatformOption($name)

Parameters

$name

getPlatformOption($name)

Parameters

$name

getColumnDefinition()

getAutoincrement()

setAutoincrement($flag)

Parameters

$flag

setComment($comment)

Parameters

$comment

getComment()

visit(Visitor $visitor)

Parameters

Visitor $visitor

array toArray()

Return Value

array