final class TableDefinition (View source)

Provides the table definition contract for the database subsystem.

Methods

__construct(string $name, array $columns = [], array $modifiedColumns = [], array $droppedColumns = [], array $indexes = [], array $droppedIndexes = [], array $foreignKeys = [], array $droppedForeignKeys = [], bool $ifNotExists = false, TableOptions|null $options = null)
create(string $name)

Builds the requested database value while preserving its framework contract.

withIfNotExists(bool $ifNotExists = true)

Updates the query or object state used by subsequent database operations.

withOptions(TableOptions|null $options)

Updates the query or object state used by subsequent database operations.

Updates the query or object state used by subsequent database operations.

Updates the query or object state used by subsequent database operations.

withoutColumn(string $column)

Updates the query or object state used by subsequent database operations.

Updates the query or object state used by subsequent database operations.

withoutIndex(string $index)

Updates the query or object state used by subsequent database operations.

Updates the query or object state used by subsequent database operations.

withoutForeignKey(string $foreignKey)

Updates the query or object state used by subsequent database operations.

string
name()

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

string
array
array
array
array
array
array
array
array
array
array
array
array
array
bool

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

bool

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

bool

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

bool
bool

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

bool

Details

__construct

__construct(string $name, array $columns = [], array $modifiedColumns = [], array $droppedColumns = [], array $indexes = [], array $droppedIndexes = [], array $foreignKeys = [], array $droppedForeignKeys = [], bool $ifNotExists = false, TableOptions|null $options = null)

No description

Parameters

string $name
array $columns
array $modifiedColumns
array $droppedColumns
array $indexes
array $droppedIndexes
array $foreignKeys
array $droppedForeignKeys
bool $ifNotExists
TableOptions|null $options

create

static TableDefinition create(string $name)

Builds the requested database value while preserving its framework contract.

Parameters

string $name

Return Value

TableDefinition

withIfNotExists

TableDefinition withIfNotExists(bool $ifNotExists = true)

Updates the query or object state used by subsequent database operations.

Parameters

bool $ifNotExists

Return Value

TableDefinition

withOptions

TableDefinition withOptions(TableOptions|null $options)

Updates the query or object state used by subsequent database operations.

Parameters

TableOptions|null $options

Return Value

TableDefinition

withColumn

Updates the query or object state used by subsequent database operations.

Parameters

ColumnDefinition $column

Return Value

TableDefinition

withModifiedColumn

TableDefinition withModifiedColumn(ColumnDefinition $column)

Updates the query or object state used by subsequent database operations.

Parameters

ColumnDefinition $column

Return Value

TableDefinition

withoutColumn

TableDefinition withoutColumn(string $column)

Updates the query or object state used by subsequent database operations.

Parameters

string $column

Return Value

TableDefinition

withIndex

Updates the query or object state used by subsequent database operations.

Parameters

IndexDefinition $index

Return Value

TableDefinition

withoutIndex

TableDefinition withoutIndex(string $index)

Updates the query or object state used by subsequent database operations.

Parameters

string $index

Return Value

TableDefinition

withForeignKey

TableDefinition withForeignKey(ForeignKeyDefinition $foreignKey)

Updates the query or object state used by subsequent database operations.

Parameters

ForeignKeyDefinition $foreignKey

Return Value

TableDefinition

withoutForeignKey

TableDefinition withoutForeignKey(string $foreignKey)

Updates the query or object state used by subsequent database operations.

Parameters

string $foreignKey

Return Value

TableDefinition

name

string name()

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

Return Value

string

columns

array columns()

No description

Return Value

array

modifiedColumns

array modifiedColumns()

No description

Return Value

array

droppedColumns

array droppedColumns()

No description

Return Value

array

indexes

array indexes()

No description

Return Value

array

droppedIndexes

array droppedIndexes()

No description

Return Value

array

foreignKeys

array foreignKeys()

No description

Return Value

array

droppedForeignKeys

array droppedForeignKeys()

No description

Return Value

array

ifNotExists

bool ifNotExists()

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

Return Value

bool

options

TableOptions|null options()

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

Return Value

TableOptions|null

hasCreateDefinitions

bool hasCreateDefinitions()

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

Return Value

bool

hasAlterDefinitions

bool hasAlterDefinitions()

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

Return Value

bool