Attention
TYPO3 v11 has reached end-of-life as of October 31th 2024 and is no longer being maintained. Use the version switcher on the top left of this page to select documentation for a supported version of TYPO3.
Need more time before upgrading? You can purchase Extended Long Term Support (ELTS) for TYPO3 v10 here: TYPO3 ELTS.
MM
New in version 11.4
TCA table column fields that define ['config']
can omit the
specification of the intermediate MM table layout in
ext_tables.sql. The TYPO3 database
analyzer takes care of proper schema definition.
Extensions are strongly encouraged to drop CREATE TABLE
definitions
from the ext_
file for those intermediate tables
referenced by TCA table columns. Dropping these definitions allows the Core
to adapt and migrate definitions if needed.
MM
-
- Type
- string (table name)
- Path
- $GLOBALS['TCA'][$table]['columns'][$field]['config']
- Scope
- Proc.
This value contains the name of the table in which to store an MM relation. It is used together with foreign_table. The database field with a MM property only stores the number of records in the relation.
Please have a look into the additional information in the MM common property description.
Warning
Copying with MM relations will not create a copy of the value. Thus copying the record
Org
withOrg->org
andA Org->org
asB New
results inNew->org
andA New->org
instead ofB New->new
andA New->new
. Deleting the relationB New->org
will result in a broken relationA Org->org
.A
MM_hasUidField
-
- Type
- boolean
- Scope
- Proc.
If the multiple property is set with MM relations you must set this value to
true
and include a UID field. Otherwise, sorting and removing relations will be buggy.
MM_opposite_field
-
- Type
- string (field name)
- Scope
- Proc.
If you want to make a MM relation editable from the foreign side (bidirectional) of the relation as well, you need to set
MM_
on the foreign side to the field name on the local side.opposite_ field For example, if the field
companies.
is your local side and you want to make the same relation editable from the foreign side of the relation in a field calledemployees persons.
, you would need to set theemployers MM_
value of the TCA configuration of theopposite_ field persons.
field to the string "employees".employers Note
Bidirectional references only get registered once on the native side in
sys_
.refindex
Examples
Inline field with MM table configured
[
'columns' => [
'inline_1' => [
'exclude' => 1,
'label' => 'inline_1',
'config' => [
'type' => 'inline',
'foreign_table' => 'tx_styleguide_inline_mm_child',
'MM' => 'tx_styleguide_inline_mm_child_rel',
'MM_hasUidField' => true,
'appearance' => [
'showSynchronizationLink' => 1,
'showAllLocalizationLink' => 1,
'showPossibleLocalizationRecords' => 1,
],
],
],
],
]
Opposite field to display MM relations two ways
[
'columns' => [
'parents' => [
'exclude' => 1,
'label' => 'parents',
'config' => [
'type' => 'inline',
'foreign_table' => 'tx_styleguide_inline_mm',
'MM' => 'tx_styleguide_inline_mm_child_rel',
'MM_hasUidField' => true,
'MM_opposite_field' => 'inline_1',
'maxitems' => 10,
'appearance' => [
'showSynchronizationLink' => 1,
'showAllLocalizationLink' => 1,
'showPossibleLocalizationRecords' => 1,
],
],
],
],
]