Column
extends AbstractAsset
in package
Object representation of a database column.
Table of Contents
Properties
- $_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
Methods
- __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 lower-cased. Lower-casing 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
$_comment
protected
string|null
$_comment
$_customSchemaOptions
protected
array<string|int, mixed>
$_customSchemaOptions
= []
Tags
$_default
protected
string|null
$_default
$_fixed
protected
bool
$_fixed
= false
$_length
protected
int|null
$_length
$_name
protected
string
$_name
= ''
$_namespace
Namespace of the asset. If none isset the default namespace is assumed.
protected
string|null
$_namespace
$_notnull
protected
bool
$_notnull
= true
$_platformOptions
protected
array<string|int, mixed>
$_platformOptions
= []
$_precision
protected
int
$_precision
= 10
$_quoted
protected
bool
$_quoted
= false
$_scale
protected
int
$_scale
= 0
$_type
protected
Type
$_type
$_unsigned
protected
bool
$_unsigned
= false
Methods
__construct()
Creates a new Column.
public
__construct(string $name, Type $type[, array<string|int, mixed> $options = [] ]) : mixed
Parameters
- $name : string
- $type : Type
- $options : array<string|int, mixed> = []
Tags
getAutoincrement()
public
getAutoincrement() : bool
Return values
boolgetColumnDefinition()
public
getColumnDefinition() : string|null
Return values
string|nullgetComment()
public
getComment() : string|null
Return values
string|nullgetCustomSchemaOption()
public
getCustomSchemaOption(string $name) : mixed
Parameters
- $name : string
Tags
getCustomSchemaOptions()
public
getCustomSchemaOptions() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>getDefault()
public
getDefault() : string|null
Return values
string|nullgetFixed()
public
getFixed() : bool
Return values
boolgetFullQualifiedName()
The normalized name is full-qualified and lower-cased. Lower-casing 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
Tags
Return values
stringgetLength()
public
getLength() : int|null
Return values
int|nullgetName()
Returns the name of this schema asset.
public
getName() : string
Return values
stringgetNamespaceName()
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|nullgetNotnull()
public
getNotnull() : bool
Return values
boolgetPlatformOption()
public
getPlatformOption(string $name) : mixed
Parameters
- $name : string
getPlatformOptions()
public
getPlatformOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>getPrecision()
public
getPrecision() : int
Return values
intgetQuotedName()
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
stringgetScale()
public
getScale() : int
Return values
intgetShortestName()
The shortest name is stripped of the default namespace. All other namespaced elements are returned as full-qualified names.
public
getShortestName(string|null $defaultNamespaceName) : string
Parameters
- $defaultNamespaceName : string|null
Return values
stringgetType()
public
getType() : Type
Return values
TypegetUnsigned()
public
getUnsigned() : bool
Return values
boolhasCustomSchemaOption()
public
hasCustomSchemaOption(string $name) : bool
Parameters
- $name : string
Tags
Return values
boolhasPlatformOption()
public
hasPlatformOption(string $name) : bool
Parameters
- $name : string
Return values
boolisInDefaultNamespace()
Is this asset in the default namespace?
public
isInDefaultNamespace(string $defaultNamespaceName) : bool
Parameters
- $defaultNamespaceName : string
Return values
boolisQuoted()
Checks if this asset's name is quoted.
public
isQuoted() : bool
Return values
boolsetAutoincrement()
public
setAutoincrement(bool $flag) : Column
Parameters
- $flag : bool
Return values
ColumnsetColumnDefinition()
public
setColumnDefinition(string|null $value) : Column
Parameters
- $value : string|null
Return values
ColumnsetComment()
public
setComment(string|null $comment) : Column
Parameters
- $comment : string|null
Return values
ColumnsetCustomSchemaOption()
public
setCustomSchemaOption(string $name, mixed $value) : Column
Parameters
- $name : string
- $value : mixed
Tags
Return values
ColumnsetCustomSchemaOptions()
public
setCustomSchemaOptions(array<string|int, mixed> $customSchemaOptions) : Column
Parameters
- $customSchemaOptions : array<string|int, mixed>
Tags
Return values
ColumnsetDefault()
public
setDefault(mixed $default) : Column
Parameters
- $default : mixed
Return values
ColumnsetFixed()
public
setFixed(bool $fixed) : Column
Parameters
- $fixed : bool
Return values
ColumnsetLength()
public
setLength(int|null $length) : Column
Parameters
- $length : int|null
Return values
ColumnsetNotnull()
public
setNotnull(bool $notnull) : Column
Parameters
- $notnull : bool
Return values
ColumnsetOptions()
public
setOptions(array<string|int, mixed> $options) : Column
Parameters
- $options : array<string|int, mixed>
Tags
Return values
ColumnsetPlatformOption()
public
setPlatformOption(string $name, mixed $value) : Column
Parameters
- $name : string
- $value : mixed
Return values
ColumnsetPlatformOptions()
public
setPlatformOptions(array<string|int, mixed> $platformOptions) : Column
Parameters
- $platformOptions : array<string|int, mixed>
Return values
ColumnsetPrecision()
public
setPrecision(int $precision) : Column
Parameters
- $precision : int
Return values
ColumnsetScale()
public
setScale(int $scale) : Column
Parameters
- $scale : int
Return values
ColumnsetType()
public
setType(Type $type) : Column
Parameters
- $type : Type
Return values
ColumnsetUnsigned()
public
setUnsigned(bool $unsigned) : Column
Parameters
- $unsigned : bool
Return values
ColumntoArray()
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, string> $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, string>
- $prefix : string = ''
- $maxSize : int = 30
Return values
string_setName()
Sets the name of this asset.
protected
_setName(string $name) : void
Parameters
- $name : string
isIdentifierQuoted()
Checks if this identifier is quoted.
protected
isIdentifierQuoted(string $identifier) : bool
Parameters
- $identifier : string
Return values
booltrimQuotes()
Trim quotes from the identifier.
protected
trimQuotes(string $identifier) : string
Parameters
- $identifier : string