Q:

TYPO3 9 Extbase: edit m:n relation from both parent and child elements in backend form

In my extension I have two models: the parent model being research groups of a doctoral program, the child model being application rounds (with opening and closing dates).  In an intermediate table I store the relationship between the two for research groups participating in application rounds.  The application rounds can overlap with certain groups participating in two parallel rounds.  That is the reason why I needed to make it an m:n relation.  I made it all work using the official documentation. 
Whereas I can select multiple application rounds in the research groups form, I additionally want to make the backend form of the application rounds show a list of all groups to select from. 
I found the information on inline fields which shows a bidirectional use – but I am struggling translating this into my extension’s situation. 
Note: I do not want inline edits, really only selectCheckBox lists on both sides. 
The Groups domain model contains the following property:
/**
 * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Myvendor\Researchgroups\Domain\Model\ApplicationRounds>
 */
protected $applicationRounds = NULL;

persisted in the database by application_rounds INT(10)
The Groups TCA contains the following definition:
$GLOBALS['TCA']['tx_researchgroups_domain_model_groups']['columns'] = [
    'application_rounds' => [
        'label' => '' .  $locLang . ' groups.recruitingSelection',
        'config' => [
            'type' => 'select',
            'renderType' => 'selectCheckBox',
            'foreign_table' => 'tx_researchgroups_domain_model_applicationrounds',
            'foreign_table_where' => 'ORDER BY tx_researchgroups_domain_model_applicationrounds.date_open DESC',
            'MM' => 'tx_researchgroups_groups_applicationrounds_mm',
            'eval' => 'int',
        ],
    ],
]

How do I add a corresponding select list to the ApplicationRounds model?  Do I have to add a property there as well, persisted in the database – even thought that would be redundant? 

A:

you need to set mm-opposite-field:

If you want to make a MM relation editable from the foreign side (bidirectional) of the relation as well, you need to set MM_opposite_field on the foreign side to the field name on the local side. 

[edit by original questioner] see next answer for the full code based on this answer

