DefaultTcaSchema
This class is called by the SchemaMigrator after all extension's ext_tables.sql files have been parsed and processed to the doctrine Table/Column/Index objects.
Method enrich() goes through all $GLOBALS['TCA'] tables and adds fields like 'uid', 'sorting', 'deleted' and friends if the feature is enabled in TCA and the field has not been defined in ext_tables.sql files.
This allows extension developers to leave out the TYPO3 DB management fields and reduce ext_tables.sql of extensions down to the business fields.
Table of Contents
Methods
- enrich() : array<non-empty-string, Table>
- Add fields to $tables array that has been created from ext_tables.sql files.
- enrichMmTables() : array<non-empty-string, Table>
- Find table fields that configure a "true" MM relation and define the according mm table schema for them. True MM tables are intermediate tables that have NO TCA itself. Those are indicated by type=select and type=group and type=inline fields with MM property.
- enrichSingleTableFieldsFromTcaColumns() : array<non-empty-string, Table>
- Add single fields based on tables TCA 'columns'.
- enrichSingleTableFieldsFromTcaCtrl() : array<non-empty-string, Table>
- Add single fields like uid, sorting and similar, based on tables TCA 'ctrl' settings.
- isColumnDefinedForTable() : bool
- True if a column with a given name is defined within the incoming array of Table's.
- isIndexDefinedForTable() : bool
- True if an index with a given name is defined within the incoming array of Table's.
- quote() : string
Methods
enrich()
Add fields to $tables array that has been created from ext_tables.sql files.
public
enrich(array<non-empty-string, Table> $tables) : array<non-empty-string, Table>
This goes through all tables defined in TCA, looks for 'ctrl' features like "soft delete" ['ctrl']['delete'] and adds the field if it has not been defined in ext_tables.sql, yet.
Parameters
- $tables : array<non-empty-string, Table>
Return values
array<non-empty-string, Table> —Modified tables
enrichMmTables()
Find table fields that configure a "true" MM relation and define the according mm table schema for them. True MM tables are intermediate tables that have NO TCA itself. Those are indicated by type=select and type=group and type=inline fields with MM property.
protected
enrichMmTables(array<non-empty-string, Table> $tables) : array<non-empty-string, Table>
Parameters
- $tables : array<non-empty-string, Table>
Return values
array<non-empty-string, Table>enrichSingleTableFieldsFromTcaColumns()
Add single fields based on tables TCA 'columns'.
protected
enrichSingleTableFieldsFromTcaColumns(array<non-empty-string, Table> $tables) : array<non-empty-string, Table>
Parameters
- $tables : array<non-empty-string, Table>
Return values
array<non-empty-string, Table>enrichSingleTableFieldsFromTcaCtrl()
Add single fields like uid, sorting and similar, based on tables TCA 'ctrl' settings.
protected
enrichSingleTableFieldsFromTcaCtrl(array<non-empty-string, Table> $tables) : array<non-empty-string, Table>
Parameters
- $tables : array<non-empty-string, Table>
Return values
array<non-empty-string, Table>isColumnDefinedForTable()
True if a column with a given name is defined within the incoming array of Table's.
protected
isColumnDefinedForTable(array<non-empty-string, Table> $tables, string $tableName, string $fieldName) : bool
Parameters
- $tables : array<non-empty-string, Table>
- $tableName : string
- $fieldName : string
Return values
boolisIndexDefinedForTable()
True if an index with a given name is defined within the incoming array of Table's.
protected
isIndexDefinedForTable(array<non-empty-string, Table> $tables, string $tableName, string $indexName) : bool
Parameters
- $tables : array<non-empty-string, Table>
- $tableName : string
- $indexName : string
Return values
boolquote()
protected
quote(string $identifier) : string
Parameters
- $identifier : string