MM-relations configuration

Things get a bit more complicated with MM-relations, where additional configuration is required. The related properties are described below.

Warning

This property is deprecated. Use multipleRows or children according to your needs. If you used the “sorting” property, use multipleSorting instead.

Depending on how you used this property, there’s no fallback and you will need to change your code. If your need was to enrich a MM table with additional information, change your TCA to use an IRRE structure instead.

See the Mapping data chapter for an overview of alternatives.

Properties

Property Data type
additionalFields array
mapping Mapping configuration
multiple boolean
sorting string

mapping

Type
Mapping configuration
Description
This is similar to the mapping property for columns. It is used to define which table to link to and which column in that table contains the external primary key.
Scope
Store data

additionalFields

Type
array
Description
List of fields that must be stored along the local and foreign keys in the MM table. For each such field, define which TYPO3 CMS MM-table field corresponds to which external data field.
Scope
Store data

multiple

Type
boolean
Description
If some MM-relations exist several times in your external data (because they have various additional fields), you must set this property to 1, so that they are preserved (otherwise the TYPO3 Core Engine will take only unique “uid_local”-“uid_foreign” pairs into account).
Scope
Store data

sorting

Type
string
Description

Indicates that the data is to be sorted according to that particular field from the external data.

Note that since the external import relies on the TYPO3 Core Engine to store the data, which sets its own numbering for sorting, thus the value in sorting is never used as is, but just for ordering the records. So if the records in the external source are already sorted, there’s no need to define the “sorting” property.

Scope
Store data

Example

This example shows how the “employee” field of the external data is mapped to the “fe_users” table to consitute the list of members in a team.

'members' => array(
        'exclude' => 0,
        'label' => 'LLL:EXT:externalimport_tut/locallang_db.xml:tx_externalimporttut_teams.members',
        'config' => array(
                'type' => 'group',
                'size' => 5,
                'internal_type' => 'db',
                'allowed' => 'fe_users',
                'MM' => 'tx_externalimporttut_teams_feusers_mm',
                'maxitems' => 100
        ),
        'external' => array(
                0 => array(
                        'field' => 'employee',
                        'MM' => array(
                                'mapping' => array(
                                        'table' => 'fe_users',
                                        'referenceField' => 'tx_externalimporttut_code',
                                        'default' => ''
                                ),
                                'sorting' => 'rank'
                        )
                )
        )
),