TableDiff

class \TYPO3\CMS\Core\Database\Schema\TableDiff

Extends
TableDiff

Based on the doctrine/dbal implementation restoring direct property access and adding further helper methods.

Table of Contents

Properties

$addedColumns  : array
$addedForeignKeys  : array
$addedIndexes  : array
$changedColumns  : array
$droppedColumns  : array
$droppedForeignKeys  : array
$droppedIndexes  : array
$modifiedForeignKeys  : array
$modifiedIndexes  : array
$newName  : string|null
$newTableName is a TYPO3 internal addition to handle renames at a later point.
$oldTable  : Table
$renamedIndexes  : array
$tableOptions  : array

Methods

__construct()  : mixed
Constructs a TableDiff object.
ensure()  : self
getAddedColumns()  : array<string, Column>
getAddedForeignKeys()  : ForeignKeyConstraint[]
getAddedIndexes()  : array<string, Index>
getChangedColumns()  : array<string, ColumnDiff>
getDroppedColumns()  : array<string, Column>
getDroppedForeignKeyConstraintNames()  : UnqualifiedName[]
Overridden, because the parent implementation reads the parent property directly. As the parent constructor is not called by intention, that property is never initialized, making the inherited method raise an `Error`. Reads the redeclared property here instead, keeping the parent behaviour.
getDroppedForeignKeys()  : ForeignKeyConstraint[]
getDroppedIndexes()  : array<string, Index>
getModifiedForeignKeys()  : ForeignKeyConstraint[]
getModifiedIndexes()  : array<string, Index>
getNewName()  : string|null
getOldTable()  : Table
getRenamedIndexes()  : array<string, Index>
getTableOption()  : string
getTableOptions()  : array<int|string, mixed>
Getter for table options.
hasTableOption()  : bool
Check if a table options has been set.
isEmpty()  : bool
setTableOptions()  : self
Setter for table options
unsetAddedIndex()  : void
unsetDroppedIndex()  : void

Properties

$addedColumns

public array $addedColumns = []

$addedForeignKeys

public array $addedForeignKeys = []

$addedIndexes

public array $addedIndexes = []

$changedColumns

public array $changedColumns = []

$droppedColumns

public array $droppedColumns = []

$droppedForeignKeys

public array $droppedForeignKeys = []

$droppedIndexes

public array $droppedIndexes = []

$modifiedForeignKeys

public array $modifiedForeignKeys = []

$modifiedIndexes

public array $modifiedIndexes = []

$newName

$newTableName is a TYPO3 internal addition to handle renames at a later point.

public string|null $newName = null

$renamedIndexes

public array $renamedIndexes = []

$tableOptions

public array $tableOptions = []

Methods

__construct()

Constructs a TableDiff object.

public __construct(Table $oldTable[, array<string, Column> $addedColumns = [] ][, array<string, ColumnDiff> $changedColumns = [] ][, array<string, Column> $droppedColumns = [] ][, array<string, Index> $addedIndexes = [] ][, array<string, Index> $modifiedIndexes = [] ][, array<string, Index> $droppedIndexes = [] ][, array<string, Index> $renamedIndexes = [] ][, ForeignKeyConstraint[] $addedForeignKeys = [] ][, ForeignKeyConstraint[] $modifiedForeignKeys = [] ][, ForeignKeyConstraint[] $droppedForeignKeys = [] ][, array<int|string, mixed> $tableOptions = [] ]) : mixed

Parameters

$oldTable : Table
$addedColumns : array<string, Column> = []
$changedColumns : array<string, ColumnDiff> = []
$droppedColumns : array<string, Column> = []
$addedIndexes : array<string, Index> = []
$modifiedIndexes : array<string, Index> = []
$droppedIndexes : array<string, Index> = []
$renamedIndexes : array<string, Index> = []
$addedForeignKeys : ForeignKeyConstraint[] = []
$modifiedForeignKeys : ForeignKeyConstraint[] = []
$droppedForeignKeys : ForeignKeyConstraint[] = []
$tableOptions : array<int|string, mixed> = []

Tags

todo

Consider to change from array to typed collections with array access support.

getAddedColumns()

public getAddedColumns() : array<string, Column>

Return values

array<string, Column>

getAddedForeignKeys()

public getAddedForeignKeys() : ForeignKeyConstraint[]

Return values

ForeignKeyConstraint[]

getAddedIndexes()

public getAddedIndexes() : array<string, Index>

Return values

array<string, Index>

getChangedColumns()

public getChangedColumns() : array<string, ColumnDiff>

Return values

array<string, ColumnDiff>

getDroppedColumns()

public getDroppedColumns() : array<string, Column>

Return values

array<string, Column>

getDroppedForeignKeyConstraintNames()

Overridden, because the parent implementation reads the parent property directly. As the parent constructor is not called by intention, that property is never initialized, making the inherited method raise an `Error`. Reads the redeclared property here instead, keeping the parent behaviour.

public getDroppedForeignKeyConstraintNames() : UnqualifiedName[]

Return values

UnqualifiedName[]

getDroppedForeignKeys()

public getDroppedForeignKeys() : ForeignKeyConstraint[]

Deprecated

Use getDroppedForeignKeyConstraintNames().

Return values

ForeignKeyConstraint[]

getDroppedIndexes()

public getDroppedIndexes() : array<string, Index>

Return values

array<string, Index>

getModifiedForeignKeys()

public getModifiedForeignKeys() : ForeignKeyConstraint[]

Deprecated

Use getAddedForeignKeys() and getDroppedForeignKeys() instead.

Return values

ForeignKeyConstraint[]

getModifiedIndexes()

public getModifiedIndexes() : array<string, Index>

Deprecated

Use getAddedIndexes() and getDroppedIndexes() instead.

Return values

array<string, Index>

getNewName()

public getNewName() : string|null

Return values

string|null

getOldTable()

public getOldTable() : Table

Return values

Table

getRenamedIndexes()

public getRenamedIndexes() : array<string, Index>

Return values

array<string, Index>

getTableOption()

public getTableOption(string $optionName) : string

Parameters

$optionName : string

Return values

string

getTableOptions()

Getter for table options.

public getTableOptions() : array<int|string, mixed>

Return values

array<int|string, mixed>

hasTableOption()

Check if a table options has been set.

public hasTableOption(string $optionName) : bool

Parameters

$optionName : string

Return values

bool

isEmpty()

public isEmpty() : bool

Return values

bool

setTableOptions()

Setter for table options

public setTableOptions(array<int|string, mixed> $tableOptions) : self

Parameters

$tableOptions : array<int|string, mixed>

Return values

self

unsetAddedIndex()

public unsetAddedIndex(Index $index) : void

Parameters

$index : Index

unsetDroppedIndex()

public unsetDroppedIndex(Index $index) : void

Parameters

$index : Index
On this page