Documentation

Column extends AbstractAsset
in package

Object representation of a database column.

Tags
link
www.doctrine-project.org
since
2.0
author

Benjamin Eberlei kontakt@beberlei.de

Table of Contents

$_autoincrement  : bool
$_columnDefinition  : string|null
$_comment  : string|null
$_customSchemaOptions  : array<string|int, mixed>
$_default  : string|null
$_fixed  : bool
$_length  : int|null
$_name  : string
$_namespace  : string|null
Namespace of the asset. If none isset the default namespace is assumed.
$_notnull  : bool
$_platformOptions  : array<string|int, mixed>
$_precision  : int
$_quoted  : bool
$_scale  : int
$_type  : Type
$_unsigned  : bool
__construct()  : mixed
Creates a new Column.
getAutoincrement()  : bool
getColumnDefinition()  : string|null
getComment()  : string|null
getCustomSchemaOption()  : mixed
getCustomSchemaOptions()  : array<string|int, mixed>
getDefault()  : string|null
getFixed()  : bool
getFullQualifiedName()  : string
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.
getLength()  : int|null
getName()  : string
Returns the name of this schema asset.
getNamespaceName()  : string|null
Gets the namespace name of this asset.
getNotnull()  : bool
getPlatformOption()  : mixed
getPlatformOptions()  : array<string|int, mixed>
getPrecision()  : int
getQuotedName()  : string
Gets the quoted representation of this asset but only if it was defined with one. Otherwise return the plain unquoted value as inserted.
getScale()  : int
getShortestName()  : string
The shortest name is stripped of the default namespace. All other namespaced elements are returned as full-qualified names.
getType()  : Type
getUnsigned()  : bool
hasCustomSchemaOption()  : bool
hasPlatformOption()  : bool
isInDefaultNamespace()  : bool
Is this asset in the default namespace?
isQuoted()  : bool
Checks if this asset's name is quoted.
setAutoincrement()  : Column
setColumnDefinition()  : Column
setComment()  : Column
setCustomSchemaOption()  : Column
setCustomSchemaOptions()  : Column
setDefault()  : Column
setFixed()  : Column
setLength()  : Column
setNotnull()  : Column
setOptions()  : Column
setPlatformOption()  : Column
setPlatformOptions()  : Column
setPrecision()  : Column
setScale()  : Column
setType()  : Column
setUnsigned()  : Column
toArray()  : array<string|int, mixed>
_generateIdentifierName()  : string
Generates an identifier from a list of column names obeying a certain string length.
_setName()  : void
Sets the name of this asset.
isIdentifierQuoted()  : bool
Checks if this identifier is quoted.
trimQuotes()  : string
Trim quotes from the identifier.

Properties

$_autoincrement

protected bool $_autoincrement = false

$_columnDefinition

protected string|null $_columnDefinition = null

$_comment

protected string|null $_comment = null

$_customSchemaOptions

protected array<string|int, mixed> $_customSchemaOptions = array()

$_default

protected string|null $_default = null

$_fixed

protected bool $_fixed = false

$_length

protected int|null $_length = null

$_namespace

Namespace of the asset. If none isset the default namespace is assumed.

protected string|null $_namespace = null

$_notnull

protected bool $_notnull = true

$_platformOptions

protected array<string|int, mixed> $_platformOptions = array()

$_precision

protected int $_precision = 10

$_scale

protected int $_scale = 0

$_unsigned

protected bool $_unsigned = false

Methods

__construct()

Creates a new Column.

public __construct(string $columnName, Type $type[, array<string|int, mixed> $options = array() ]) : mixed
Parameters
$columnName : string
$type : Type
$options : array<string|int, mixed> = array()
Return values
mixed —

getAutoincrement()

public getAutoincrement() : bool
Return values
bool —

getColumnDefinition()

public getColumnDefinition() : string|null
Return values
string|null —

getComment()

public getComment() : string|null
Return values
string|null —

getCustomSchemaOption()

public getCustomSchemaOption(string $name) : mixed
Parameters
$name : string
Return values
mixed —

getCustomSchemaOptions()

public getCustomSchemaOptions() : array<string|int, mixed>
Return values
array<string|int, mixed> —

getDefault()

public getDefault() : string|null
Return values
string|null —

getFixed()

public getFixed() : bool
Return values
bool —

getFullQualifiedName()

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.

public getFullQualifiedName(string $defaultNamespaceName) : string

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

Parameters
$defaultNamespaceName : string
Return values
string —

getLength()

public getLength() : int|null
Return values
int|null —

getName()

Returns the name of this schema asset.

public getName() : string
Return values
string —

getNamespaceName()

Gets the namespace name of this asset.

public getNamespaceName() : string|null

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

Return values
string|null —

getNotnull()

public getNotnull() : bool
Return values
bool —

getPlatformOption()

public getPlatformOption(string $name) : mixed
Parameters
$name : string
Return values
mixed —

getPlatformOptions()

public getPlatformOptions() : array<string|int, mixed>
Return values
array<string|int, mixed> —

getPrecision()

public getPrecision() : int
Return values
int —

getQuotedName()

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

public getQuotedName(AbstractPlatform $platform) : string
Parameters
$platform : AbstractPlatform
Return values
string —

getScale()

public getScale() : int
Return values
int —

getShortestName()

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

public getShortestName(string $defaultNamespaceName) : string
Parameters
$defaultNamespaceName : string
Return values
string —

getUnsigned()

public getUnsigned() : bool
Return values
bool —

hasCustomSchemaOption()

public hasCustomSchemaOption(string $name) : bool
Parameters
$name : string
Return values
bool —

hasPlatformOption()

public hasPlatformOption(string $name) : bool
Parameters
$name : string
Return values
bool —

isInDefaultNamespace()

Is this asset in the default namespace?

public isInDefaultNamespace(string $defaultNamespaceName) : bool
Parameters
$defaultNamespaceName : string
Return values
bool —

isQuoted()

Checks if this asset's name is quoted.

public isQuoted() : bool
Return values
bool —

setAutoincrement()

public setAutoincrement(bool $flag) : Column
Parameters
$flag : bool
Return values
Column —

setColumnDefinition()

public setColumnDefinition(string $value) : Column
Parameters
$value : string
Return values
Column —

setComment()

public setComment(string $comment) : Column
Parameters
$comment : string
Return values
Column —

setCustomSchemaOption()

public setCustomSchemaOption(string $name, mixed $value) : Column
Parameters
$name : string
$value : mixed
Return values
Column —

setCustomSchemaOptions()

public setCustomSchemaOptions(array<string|int, mixed> $customSchemaOptions) : Column
Parameters
$customSchemaOptions : array<string|int, mixed>
Return values
Column —

setDefault()

public setDefault(mixed $default) : Column
Parameters
$default : mixed
Return values
Column —

setFixed()

public setFixed(bool $fixed) : Column
Parameters
$fixed : bool
Return values
Column —

setLength()

public setLength(int|null $length) : Column
Parameters
$length : int|null
Return values
Column —

setNotnull()

public setNotnull(bool $notnull) : Column
Parameters
$notnull : bool
Return values
Column —

setOptions()

public setOptions(array<string|int, mixed> $options) : Column
Parameters
$options : array<string|int, mixed>
Return values
Column —

setPlatformOption()

public setPlatformOption(string $name, mixed $value) : Column
Parameters
$name : string
$value : mixed
Return values
Column —

setPlatformOptions()

public setPlatformOptions(array<string|int, mixed> $platformOptions) : Column
Parameters
$platformOptions : array<string|int, mixed>
Return values
Column —

setPrecision()

public setPrecision(int $precision) : Column
Parameters
$precision : int
Return values
Column —

setScale()

public setScale(int $scale) : Column
Parameters
$scale : int
Return values
Column —

setUnsigned()

public setUnsigned(bool $unsigned) : Column
Parameters
$unsigned : bool
Return values
Column —

toArray()

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed> —

_generateIdentifierName()

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

protected _generateIdentifierName(array<string|int, mixed> $columnNames[, string $prefix = '' ][, int $maxSize = 30 ]) : string

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
$columnNames : array<string|int, mixed>
$prefix : string = ''
$maxSize : int = 30
Return values
string —

_setName()

Sets the name of this asset.

protected _setName(string $name) : void
Parameters
$name : string
Return values
void —

isIdentifierQuoted()

Checks if this identifier is quoted.

protected isIdentifierQuoted(string $identifier) : bool
Parameters
$identifier : string
Return values
bool —

trimQuotes()

Trim quotes from the identifier.

protected trimQuotes(string $identifier) : string
Parameters
$identifier : string
Return values
string —

Search results