final class ColumnDefinition (View source)

Provides the column definition contract for the database subsystem.

Methods

__construct(string $name, ColumnType|string $type, int|string|null $length = null, bool $unsigned = false, bool $nullable = false, bool $hasDefault = false, mixed $default = null, bool $autoIncrement = false, string|null $comment = null, string|null $after = null, bool $first = false, string|null $renameTo = null, string|null $literal = null)

Initializes this ColumnDefinition with the collaborators and state required by its database contract.

raw(string $definition)

Provides this part of the database contract while preserving the object's current state and driver semantics.

id(string $name = 'id')

Provides this part of the database contract while preserving the object's current state and driver semantics.

string(string $name, int $length = 255)

Provides this part of the database contract while preserving the object's current state and driver semantics.

integer(string $name)

Provides this part of the database contract while preserving the object's current state and driver semantics.

datetime(string $name)

Provides this part of the database contract while preserving the object's current state and driver semantics.

text(string $name)

Provides this part of the database contract while preserving the object's current state and driver semantics.

nullable(bool $nullable = true)

Provides this part of the database contract while preserving the object's current state and driver semantics.

unsigned(bool $unsigned = true)

Provides this part of the database contract while preserving the object's current state and driver semantics.

default(mixed $value)

Provides this part of the database contract while preserving the object's current state and driver semantics.

defaultExpression(string $expression)

Provides this part of the database contract while preserving the object's current state and driver semantics.

autoIncrement(bool $autoIncrement = true)

Provides this part of the database contract while preserving the object's current state and driver semantics.

comment(string|null $comment)

Provides this part of the database contract while preserving the object's current state and driver semantics.

after(string|null $column)

Provides this part of the database contract while preserving the object's current state and driver semantics.

first(bool $first = true)

Retrieves the requested value without changing the current database state.

renameTo(string|null $name)

Provides this part of the database contract while preserving the object's current state and driver semantics.

string
name()

Provides this part of the database contract while preserving the object's current state and driver semantics.

string
ColumnType|string
type()

Provides this part of the database contract while preserving the object's current state and driver semantics.

ColumnType|string
string

Provides this part of the database contract while preserving the object's current state and driver semantics.

string
int|string|null
length()

Provides this part of the database contract while preserving the object's current state and driver semantics.

int|string|null
bool

Reports whether the requested condition holds for the current database state.

bool
bool

Provides this part of the database contract while preserving the object's current state and driver semantics.

bool
bool

Reports whether the requested condition holds for the current database state.

bool
mixed

Provides this part of the database contract while preserving the object's current state and driver semantics.

mixed
bool

Reports whether the requested condition holds for the current database state.

bool
string|null

Provides this part of the database contract while preserving the object's current state and driver semantics.

string|null
string|null

Provides this part of the database contract while preserving the object's current state and driver semantics.

string|null
bool

Retrieves the requested value without changing the current database state.

bool
string|null

Provides this part of the database contract while preserving the object's current state and driver semantics.

string|null
string|null

Provides this part of the database contract while preserving the object's current state and driver semantics.

string|null
bool

Reports whether the requested condition holds for the current database state.

bool

Details

__construct

__construct(string $name, ColumnType|string $type, int|string|null $length = null, bool $unsigned = false, bool $nullable = false, bool $hasDefault = false, mixed $default = null, bool $autoIncrement = false, string|null $comment = null, string|null $after = null, bool $first = false, string|null $renameTo = null, string|null $literal = null)

Initializes this ColumnDefinition with the collaborators and state required by its database contract.

Parameters

string $name
ColumnType|string $type
int|string|null $length
bool $unsigned
bool $nullable
bool $hasDefault
mixed $default
bool $autoIncrement
string|null $comment
string|null $after
bool $first
string|null $renameTo
string|null $literal

raw

static ColumnDefinition raw(string $definition)

Provides this part of the database contract while preserving the object's current state and driver semantics.

Parameters

string $definition

Return Value

ColumnDefinition

id

static ColumnDefinition id(string $name = 'id')

Provides this part of the database contract while preserving the object's current state and driver semantics.

Parameters

string $name

Return Value

ColumnDefinition

string

static ColumnDefinition string(string $name, int $length = 255)

Provides this part of the database contract while preserving the object's current state and driver semantics.

Parameters

string $name
int $length

Return Value

ColumnDefinition

integer

static ColumnDefinition integer(string $name)

Provides this part of the database contract while preserving the object's current state and driver semantics.

Parameters

string $name

Return Value

ColumnDefinition

datetime

static ColumnDefinition datetime(string $name)

Provides this part of the database contract while preserving the object's current state and driver semantics.

Parameters

string $name

Return Value

ColumnDefinition

text

static ColumnDefinition text(string $name)

Provides this part of the database contract while preserving the object's current state and driver semantics.

Parameters

string $name

Return Value

ColumnDefinition

nullable

ColumnDefinition nullable(bool $nullable = true)

Provides this part of the database contract while preserving the object's current state and driver semantics.

Parameters

bool $nullable

Return Value

ColumnDefinition

unsigned

ColumnDefinition unsigned(bool $unsigned = true)

Provides this part of the database contract while preserving the object's current state and driver semantics.

Parameters

bool $unsigned

Return Value

ColumnDefinition

default

ColumnDefinition default(mixed $value)

Provides this part of the database contract while preserving the object's current state and driver semantics.

Parameters

mixed $value

Return Value

ColumnDefinition

defaultExpression

ColumnDefinition defaultExpression(string $expression)

Provides this part of the database contract while preserving the object's current state and driver semantics.

Parameters

string $expression

Return Value

ColumnDefinition

autoIncrement

ColumnDefinition autoIncrement(bool $autoIncrement = true)

Provides this part of the database contract while preserving the object's current state and driver semantics.

Parameters

bool $autoIncrement

Return Value

ColumnDefinition

comment

ColumnDefinition comment(string|null $comment)

Provides this part of the database contract while preserving the object's current state and driver semantics.

Parameters

string|null $comment

Return Value

ColumnDefinition

after

ColumnDefinition after(string|null $column)

Provides this part of the database contract while preserving the object's current state and driver semantics.

Parameters

string|null $column

Return Value

ColumnDefinition

first

ColumnDefinition first(bool $first = true)

Retrieves the requested value without changing the current database state.

Parameters

bool $first

Return Value

ColumnDefinition

renameTo

ColumnDefinition renameTo(string|null $name)

Provides this part of the database contract while preserving the object's current state and driver semantics.

Parameters

string|null $name

Return Value

ColumnDefinition

name

string name()

Provides this part of the database contract while preserving the object's current state and driver semantics.

Return Value

string

type

ColumnType|string type()

Provides this part of the database contract while preserving the object's current state and driver semantics.

Return Value

ColumnType|string

typeValue

string typeValue()

Provides this part of the database contract while preserving the object's current state and driver semantics.

Return Value

string

length

int|string|null length()

Provides this part of the database contract while preserving the object's current state and driver semantics.

Return Value

int|string|null

isUnsigned

bool isUnsigned()

Reports whether the requested condition holds for the current database state.

Return Value

bool

nullableFlag

bool nullableFlag()

Provides this part of the database contract while preserving the object's current state and driver semantics.

Return Value

bool

hasDefault

bool hasDefault()

Reports whether the requested condition holds for the current database state.

Return Value

bool

defaultValue

mixed defaultValue()

Provides this part of the database contract while preserving the object's current state and driver semantics.

Return Value

mixed

isAutoIncrement

bool isAutoIncrement()

Reports whether the requested condition holds for the current database state.

Return Value

bool

commentText

string|null commentText()

Provides this part of the database contract while preserving the object's current state and driver semantics.

Return Value

string|null

afterColumn

string|null afterColumn()

Provides this part of the database contract while preserving the object's current state and driver semantics.

Return Value

string|null

firstPosition

bool firstPosition()

Retrieves the requested value without changing the current database state.

Return Value

bool

renameTarget

string|null renameTarget()

Provides this part of the database contract while preserving the object's current state and driver semantics.

Return Value

string|null

literal

string|null literal()

Provides this part of the database contract while preserving the object's current state and driver semantics.

Return Value

string|null

isLiteral

bool isLiteral()

Reports whether the requested condition holds for the current database state.

Return Value

bool