class Column extends AbstractAsset (View source)

Object representation of a database column.

Properties

protected string $_name from AbstractAsset
protected string|null $_namespace Namespace of the asset. If none isset the default namespace is assumed. from AbstractAsset
protected boolean $_quoted from AbstractAsset
protected Type $_type
protected integer|null $_length
protected integer $_precision
protected integer $_scale
protected boolean $_unsigned
protected boolean $_fixed
protected boolean $_notnull
protected string|null $_default
protected boolean $_autoincrement
protected array $_platformOptions
protected string|null $_columnDefinition
protected string|null $_comment
protected array $_customSchemaOptions

Methods

void
_setName(string $name)

Sets the name of this asset.

boolean
isInDefaultNamespace(string $defaultNamespaceName)

Is this asset in the default namespace?

string|null
getNamespaceName()

Gets the namespace name of this asset.

string
getShortestName(string $defaultNamespaceName)

The shortest name is stripped of the default namespace. All other namespaced elements are returned as full-qualified names.

string
getFullQualifiedName(string $defaultNamespaceName)

The normalized name is full-qualified and lowerspaced. Lowerspacing is actually wrong, but we have to do it to keep our sanity. If you are using database objects that only differentiate in the casing (FOO vs Foo) then you will NOT be able to use Doctrine Schema abstraction.

boolean
isQuoted()

Checks if this asset's name is quoted.

boolean
isIdentifierQuoted(string $identifier)

Checks if this identifier is quoted.

string
trimQuotes(string $identifier)

Trim quotes from the identifier.

string
getName()

Returns the name of this schema asset.

string
getQuotedName(AbstractPlatform $platform)

Gets 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 = '', integer $maxSize = 30)

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

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

Creates a new Column.

setOptions(array $options)

No description

setType(Type $type)

No description

setLength(integer|null $length)

No description

setPrecision(integer $precision)

No description

setScale(integer $scale)

No description

setUnsigned(boolean $unsigned)

No description

setFixed(boolean $fixed)

No description

setNotnull(boolean $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

integer|null
getLength()

No description

integer
getPrecision()

No description

integer
getScale()

No description

boolean
getUnsigned()

No description

boolean
getFixed()

No description

boolean
getNotnull()

No description

string|null
getDefault()

No description

array
getPlatformOptions()

No description

boolean
hasPlatformOption(string $name)

No description

mixed
getPlatformOption(string $name)

No description

string|null
getColumnDefinition()

No description

boolean
getAutoincrement()

No description

setAutoincrement(boolean $flag)

No description

setComment(string $comment)

No description

string|null
getComment()

No description

setCustomSchemaOption(string $name, mixed $value)

No description

boolean
hasCustomSchemaOption(string $name)

No description

mixed
getCustomSchemaOption(string $name)

No description

setCustomSchemaOptions(array $customSchemaOptions)

No description

array
getCustomSchemaOptions()

No description

array
toArray()

No description

Details

protected void _setName(string $name)

Sets the name of this asset.

Parameters

string $name

Return Value

void

boolean isInDefaultNamespace(string $defaultNamespaceName)

Is this asset in the default namespace?

Parameters

string $defaultNamespaceName

Return Value

boolean

string|null getNamespaceName()

Gets the namespace name of this asset.

If NULL is returned this means the default namespace is used.

Return Value

string|null

string getShortestName(string $defaultNamespaceName)

The shortest name is stripped of the default namespace. All other namespaced elements are returned as full-qualified names.

Parameters

string $defaultNamespaceName

Return Value

string

string getFullQualifiedName(string $defaultNamespaceName)

The normalized name is full-qualified and lowerspaced. Lowerspacing is actually wrong, but we have to do it to keep our sanity. If you are using database objects that only differentiate in the casing (FOO vs Foo) then you will NOT be able to use Doctrine Schema abstraction.

Every non-namespaced element is prefixed with the default namespace name which is passed as argument to this method.

Parameters

string $defaultNamespaceName

Return Value

string

boolean isQuoted()

Checks if this asset's name is quoted.

Return Value

boolean

protected boolean isIdentifierQuoted(string $identifier)

Checks if this identifier is quoted.

Parameters

string $identifier

Return Value

boolean

protected string trimQuotes(string $identifier)

Trim quotes from the identifier.

Parameters

string $identifier

Return Value

string

string getName()

Returns the name of this schema asset.

Return Value

string

string getQuotedName(AbstractPlatform $platform)

Gets 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 = '', integer $maxSize = 30)

Generates 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
integer $maxSize

Return Value

string

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

Creates a new Column.

Parameters

string $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(integer|null $length)

Parameters

integer|null $length

Return Value

Column

Column setPrecision(integer $precision)

Parameters

integer $precision

Return Value

Column

Column setScale(integer $scale)

Parameters

integer $scale

Return Value

Column

Column setUnsigned(boolean $unsigned)

Parameters

boolean $unsigned

Return Value

Column

Column setFixed(boolean $fixed)

Parameters

boolean $fixed

Return Value

Column

Column setNotnull(boolean $notnull)

Parameters

boolean $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

Type getType()

Return Value

Type

integer|null getLength()

Return Value

integer|null

integer getPrecision()

Return Value

integer

integer getScale()

Return Value

integer

boolean getUnsigned()

Return Value

boolean

boolean getFixed()

Return Value

boolean

boolean getNotnull()

Return Value

boolean

string|null getDefault()

Return Value

string|null

array getPlatformOptions()

Return Value

array

boolean hasPlatformOption(string $name)

Parameters

string $name

Return Value

boolean

mixed getPlatformOption(string $name)

Parameters

string $name

Return Value

mixed

string|null getColumnDefinition()

Return Value

string|null

boolean getAutoincrement()

Return Value

boolean

Column setAutoincrement(boolean $flag)

Parameters

boolean $flag

Return Value

Column

Column setComment(string $comment)

Parameters

string $comment

Return Value

Column

string|null getComment()

Return Value

string|null

Column setCustomSchemaOption(string $name, mixed $value)

Parameters

string $name
mixed $value

Return Value

Column

boolean hasCustomSchemaOption(string $name)

Parameters

string $name

Return Value

boolean

mixed getCustomSchemaOption(string $name)

Parameters

string $name

Return Value

mixed

Column setCustomSchemaOptions(array $customSchemaOptions)

Parameters

array $customSchemaOptions

Return Value

Column

array getCustomSchemaOptions()

Return Value

array

array toArray()

Return Value

array