final class ForeignKeyDefinition (View source)

Provides the foreign key definition contract for the database subsystem.

Methods

__construct(array $columns, string $referencedTable, array $referencedColumns = ['id'], string|null $name = null, ForeignKeyAction|null $onUpdate = null, ForeignKeyAction|null $onDelete = null)
make(string|array $columns, string $referencedTable, string|array $referencedColumns = ['id'], string|null $name = null)

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

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

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

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

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

onUpdate(ForeignKeyAction $action)

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

onDelete(ForeignKeyAction $action)

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

array
array
string

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

string
array
string|null
name()

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

string|null
string

Resolves the effective value from the configured database dependencies and input.

string
ForeignKeyAction|null

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

ForeignKeyAction|null
ForeignKeyAction|null

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

ForeignKeyAction|null

Details

__construct

__construct(array $columns, string $referencedTable, array $referencedColumns = ['id'], string|null $name = null, ForeignKeyAction|null $onUpdate = null, ForeignKeyAction|null $onDelete = null)

No description

Parameters

array $columns
string $referencedTable
array $referencedColumns
string|null $name
ForeignKeyAction|null $onUpdate
ForeignKeyAction|null $onDelete

make

static ForeignKeyDefinition make(string|array $columns, string $referencedTable, string|array $referencedColumns = ['id'], string|null $name = null)

No description

Parameters

string|array $columns
string $referencedTable
string|array $referencedColumns
string|null $name

Return Value

ForeignKeyDefinition

cascadeOnUpdate

ForeignKeyDefinition cascadeOnUpdate()

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

Return Value

ForeignKeyDefinition

cascadeOnDelete

ForeignKeyDefinition cascadeOnDelete()

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

Return Value

ForeignKeyDefinition

restrictOnUpdate

ForeignKeyDefinition restrictOnUpdate()

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

Return Value

ForeignKeyDefinition

restrictOnDelete

ForeignKeyDefinition restrictOnDelete()

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

Return Value

ForeignKeyDefinition

nullOnDelete

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

Return Value

ForeignKeyDefinition

onUpdate

ForeignKeyDefinition onUpdate(ForeignKeyAction $action)

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

Parameters

ForeignKeyAction $action

Return Value

ForeignKeyDefinition

onDelete

ForeignKeyDefinition onDelete(ForeignKeyAction $action)

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

Parameters

ForeignKeyAction $action

Return Value

ForeignKeyDefinition

columns

array columns()

No description

Return Value

array

referencedTable

string referencedTable()

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

Return Value

string

referencedColumns

array referencedColumns()

No description

Return Value

array

name

string|null name()

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

Return Value

string|null

resolvedName

string resolvedName()

Resolves the effective value from the configured database dependencies and input.

Return Value

string

updateAction

ForeignKeyAction|null updateAction()

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

Return Value

ForeignKeyAction|null

deleteAction

ForeignKeyAction|null deleteAction()

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

Return Value

ForeignKeyAction|null