‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Database\Schema\TableDiff Class Reference
Inheritance diagram for TYPO3\CMS\Core\Database\Schema\TableDiff:

Public Member Functions

 __construct (public Table $oldTable, public array $addedColumns, public array $modifiedColumns, public array $droppedColumns, public array $renamedColumns, public array $addedIndexes, public array $modifiedIndexes, public array $droppedIndexes, public array $renamedIndexes, public array $addedForeignKeys, public array $modifiedForeignKeys, public array $droppedForeignKeys, public array $tableOptions=[],)
 
 setTableOptions (array $tableOptions)
 
 hasTableOption (string $optionName)
 
 getTableOption (string $optionName)
 
 getOldTable ()
 
array< string, Index > getRenamedIndexes ()
 
array< ForeignKeyConstraint > getAddedForeignKeys ()
 
array< ForeignKeyConstraint > getModifiedForeignKeys ()
 
array< ForeignKeyConstraint > getDroppedForeignKeys ()
 
 isEmpty ()
 
 getNewName ()
 
 unsetAddedIndex (Index $index)
 
 unsetDroppedIndex (Index $index)
 

Static Public Member Functions

static ensure (DoctrineTableDiff|TableDiff $tableDiff)
 

Public Attributes

string $newName = null
 
array< int|string, function getTableOptions():array { return $this-> tableOptions
 
array< string, function getAddedColumns():array { return $this-> addedColumns
 
array< string, function getModifiedColumns():array { return $this-> modifiedColumns
 
array< string, function getDroppedColumns():array { return $this-> droppedColumns
 
array< string, function getRenamedColumns():array { return $this-> renamedColumns
 
array< string, function getAddedIndexes():array { return $this-> addedIndexes
 
array< string, function getModifiedIndexes():array { return $this-> modifiedIndexes
 
array< string, function getDroppedIndexes():array { return $this-> droppedIndexes
 

Detailed Description

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

not part of public core API.

Definition at line 32 of file TableDiff.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Database\Schema\TableDiff::__construct ( public Table  $oldTable,
public array  $addedColumns,
public array  $modifiedColumns,
public array  $droppedColumns,
public array  $renamedColumns,
public array  $addedIndexes,
public array  $modifiedIndexes,
public array  $droppedIndexes,
public array  $renamedIndexes,
public array  $addedForeignKeys,
public array  $modifiedForeignKeys,
public array  $droppedForeignKeys,
public array  $tableOptions = [] 
)

Constructs a TableDiff object.

Parameters
array<string,Column>‪$addedColumns
array<string,ColumnDiff>‪$modifiedColumns
array<string,Column>‪$droppedColumns
array<string,Column>‪$renamedColumns
array<string,Index>‪$addedIndexes
array<string,Index>‪$modifiedIndexes
array<string,Index>‪$droppedIndexes
array<string,Index>‪$renamedIndexes
array<ForeignKeyConstraint>‪$addedForeignKeys
array<ForeignKeyConstraint>‪$modifiedForeignKeys
array<ForeignKeyConstraint>‪$droppedForeignKeys
array<int|string,mixed>‪$tableOptions

The diff can be only instantiated by a {

See also
Comparator}.
Todo:
‪Consider to change from array to typed collections with array access support.

Definition at line 59 of file TableDiff.php.

Member Function Documentation

◆ ensure()

◆ getAddedForeignKeys()

array<ForeignKeyConstraint> TYPO3\CMS\Core\Database\Schema\TableDiff::getAddedForeignKeys ( )

◆ getDroppedForeignKeys()

array<ForeignKeyConstraint> TYPO3\CMS\Core\Database\Schema\TableDiff::getDroppedForeignKeys ( )

◆ getModifiedForeignKeys()

array<ForeignKeyConstraint> TYPO3\CMS\Core\Database\Schema\TableDiff::getModifiedForeignKeys ( )

◆ getNewName()

TYPO3\CMS\Core\Database\Schema\TableDiff::getNewName ( )

◆ getOldTable()

TYPO3\CMS\Core\Database\Schema\TableDiff::getOldTable ( )

Definition at line 115 of file TableDiff.php.

Referenced by TYPO3\CMS\Core\Database\Schema\TableDiff\ensure().

◆ getRenamedIndexes()

array<string,Index> TYPO3\CMS\Core\Database\Schema\TableDiff::getRenamedIndexes ( )

◆ getTableOption()

TYPO3\CMS\Core\Database\Schema\TableDiff::getTableOption ( string  $optionName)

◆ hasTableOption()

TYPO3\CMS\Core\Database\Schema\TableDiff::hasTableOption ( string  $optionName)

Check if a table options has been set.

Definition at line 101 of file TableDiff.php.

References TYPO3\CMS\Core\Database\Schema\TableDiff\tableOptions.

Referenced by TYPO3\CMS\Core\Database\Schema\TableDiff\getTableOption().

◆ isEmpty()

◆ setTableOptions()

TYPO3\CMS\Core\Database\Schema\TableDiff::setTableOptions ( array  $tableOptions)

Setter for table options

Parameters
array<int|string,mixed>‪$tableOptions

Definition at line 92 of file TableDiff.php.

References TYPO3\CMS\Core\Database\Schema\TableDiff\tableOptions.

◆ unsetAddedIndex()

TYPO3\CMS\Core\Database\Schema\TableDiff::unsetAddedIndex ( Index  $index)

This method exists only for compatibility with the current implementation of schema managers that modify the diff while processing it.

Definition at line 269 of file TableDiff.php.

References TYPO3\CMS\Core\Database\Schema\TableDiff\addedIndexes.

◆ unsetDroppedIndex()

TYPO3\CMS\Core\Database\Schema\TableDiff::unsetDroppedIndex ( Index  $index)

This method exists only for compatibility with the current implementation of schema managers that modify the diff while processing it.

Definition at line 283 of file TableDiff.php.

References TYPO3\CMS\Core\Database\Schema\TableDiff\droppedIndexes.

Member Data Documentation

◆ $newName

string TYPO3\CMS\Core\Database\Schema\TableDiff::$newName = null

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

Definition at line 37 of file TableDiff.php.

Referenced by TYPO3\CMS\Core\Database\Schema\TableDiff\getNewName().

◆ addedColumns

array<string, function getAddedColumns(): array { return $this-> TYPO3\CMS\Core\Database\Schema\TableDiff::addedColumns

Definition at line 123 of file TableDiff.php.

◆ addedIndexes

array<string, function getAddedIndexes(): array { return $this-> TYPO3\CMS\Core\Database\Schema\TableDiff::addedIndexes

◆ droppedColumns

array<string, function getDroppedColumns(): array { return $this-> TYPO3\CMS\Core\Database\Schema\TableDiff::droppedColumns

Definition at line 135 of file TableDiff.php.

◆ droppedIndexes

array<string, function getDroppedIndexes(): array { return $this-> TYPO3\CMS\Core\Database\Schema\TableDiff::droppedIndexes

◆ modifiedColumns

array<string, function getModifiedColumns(): array { return $this-> TYPO3\CMS\Core\Database\Schema\TableDiff::modifiedColumns

Definition at line 129 of file TableDiff.php.

◆ modifiedIndexes

array<string, function getModifiedIndexes(): array { return $this-> TYPO3\CMS\Core\Database\Schema\TableDiff::modifiedIndexes

Definition at line 153 of file TableDiff.php.

◆ renamedColumns

array<string, function getRenamedColumns(): array { return $this-> TYPO3\CMS\Core\Database\Schema\TableDiff::renamedColumns

Definition at line 141 of file TableDiff.php.

◆ tableOptions

array<int|string, function getTableOptions(): array { return $this-> TYPO3\CMS\Core\Database\Schema\TableDiff::tableOptions