Uuid
The main purpose of the TCA type uuid is to simplify the TCA
configuration when working with fields containing a UUID.
The matching database field is generated automatically.
Changed in version 14.0
The TYPO3 Doctrine implementation can now handle the proper matching database type for UUIDs.
PostgreSQL natively supports the UUID data type and is a lot faster
than the previous VARCHAR generated from the string type.
The Doctrine DBAL GUID type uses a fixed field column size of CHAR
for non-PostgreSQL databases, which is compatible as long
as valid UUID values have been persisted in the configured database
table.
Table of contents:
Example
Each speaker has an identifier that does not depend on the database:
The identifier of a speaker
<?php
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
defined('TYPO3') or die();
ExtensionManagementUtility::addTCAcolumns('tx_myextension_speaker', [
'identifier' => [
'label' => 'my_extension.db:speaker.identifier',
'config' => [
'type' => 'uuid',
// Time-ordered, so new speakers sort after older ones
'version' => 7,
// Editors do not search for a random identifier
'searchable' => false,
],
],
]);
ExtensionManagementUtility::addToAllTCAtypes(
'tx_myextension_speaker',
'identifier',
'',
'before:--div--;core.form.tabs:access',
);
Properties of the TCA column type uuid
| Name | Type | Scope |
|---|---|---|
| array | Display | |
| boolean | ||
| boolean | Display | |
| boolean | Display / Proc. | |
| boolean | Display | |
| integer | Display | |
| integer | Display |
-
- Type
- array
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['appearance']
- Scope
- Display
- Added
- 15.0
Has information about the appearance, namely:
-
- Type
- boolean
- Default
- true
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['appearance']['copyToClipboard']
- Added
- 15.0, Deprecation: #110865 - uuid option enableCopyToClipboard moved to appearance
Shows a button next to the input field. The button copies the UUID to the clipboard of the operating system.
Page TSconfig can override the option for a field, see TCEFORM config:
EXT:my_extension/Configuration/page.tsconfigTCEFORM.tx_myextension_speaker.identifier.config.appearance.copyToClipboard = 0Copied!
-
- Type
- boolean
- Default
- true
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['enableCopyToClipboard']
- Scope
- Display
- Deprecated
- 15.0, Deprecation: #110865 - uuid option enableCopyToClipboard moved to appearance
Shows a button next to the input field. The button copies the UUID to the clipboard of the operating system.
Use appearance.copyToClipboard instead. The TCA migration converts this option, also in
columnsand in FlexForm fields.Overrides The page TSconfig
TCEFORM.<table>.<field>.works until TYPO3 v16.0. Useconfig. enable Copy To Clipboard TCEFORM.<table>.<field>.instead.config. appearance. copy To Clipboard
-
For details see fieldInformation.
-
- Type
- boolean
- Default
- false
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['required']
- Scope
- Display / Proc.
If set to true a non-empty value is required in the field. Otherwise the form cannot be saved.
-
- Type
- boolean
- Default
true- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['searchable']
- Scope
- Display
New in version 14.0
TYPO3 now automatically includes all fields of suitable types in backend search operations in the Content > Records module.
This option can be used to explicitly exclude fields from being searchable, instead of having to list them in the now removed option $GLOBALS['TCA'][$table]['ctrl']['searchFields'].
By default, all fields of type
uuidare considered searchable. To exclude a field from being searchable, set the following in the field's TCA configuration:EXT:my_extension/Configuration/TCA/Overrides/335-tx_myextension_speaker-identifier.php<?php use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; defined('TYPO3') or die(); ExtensionManagementUtility::addTCAcolumns('tx_myextension_speaker', [ 'identifier' => [ 'label' => 'my_extension.db:speaker.identifier', 'config' => [ 'type' => 'uuid', // Time-ordered, so new speakers sort after older ones 'version' => 7, // Editors do not search for a random identifier 'searchable' => false, ], ], ]); ExtensionManagementUtility::addToAllTCAtypes( 'tx_myextension_speaker', 'identifier', '', 'before:--div--;core.form.tabs:access', );
-
- Type
- integer
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['size']
- Scope
- Display
Abstract value for the width of the
<input>field. To set the field to the full width of the form area, use the value 50. Minimum is 10. Default is 30.This column configuration can be overwritten by page TSconfig.
-
- Type
- integer
- TCA path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']['version']
- Scope
- Display
The
versionoption defines the UUID version to be used. Allowed values are4,6or7. The default is4. For more information about the different versions, have a look at the corresponding Symfony documentation.