title: How can I handle a TCA multi select like a inline field in TYPO3?
body: <p>Maybe my question sounds a little bit weird. So here are the details:</p>
  
  <p>I have created the two classes "Position" and "Step". Furthermore every step can contain positions. My tables and the relevant fields looks like the following: </p>
  
  <pre><code>CREATE TABLE tx_foxexample_domain_model_step (
      ...
      positions int(11) unsigned DEFAULT '0' NOT NULL,
      ...
  );
  
  CREATE TABLE tx_foxexample_domain_model_position (
     ...
     step int(11) unsigned DEFAULT '0' NOT NULL,
     ...
  );
  </code></pre>
  
  <p>I think it is a normal 1:n relation, because each step can store n-positions and every position could be part of only one step.</p>
  
  <p>My classes and the relevant properties looks like the following:</p>
  
  <pre><code>class Step extends AbstractEntity
  {
      ...
      /**
       * Positions
       *
       * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage&lt;\Fox\FoxExample\Domain\Model\Position&gt;
       * @cascade remove
       */
       protected $positions = null;
       ...
  }
  
  class Position extends AbstractEntity
  {
     ...
     /**
      * Stores the relation to step
      *
      * @var \Fox\FoxExample\Domain\Model\Step
      */
      protected $step = null;
     ...
  }
  </code></pre>
  
  <p>The step stores n-positions in a object storage property and the position just stores the relevant step in a step property.</p>
  
  <p>So far I have created a position or some positions for a step directly inline via the inline field, the TCA for my step was like the following: </p>
  
  <pre><code>...
  'positions' =&gt; array(
      'exclude' =&gt; 1,
      'label' =&gt; '...',
      'config' =&gt; array(
          'type' =&gt; 'inline',
           'foreign_table' =&gt; 'tx_foxexample_domain_model_position',
           'foreign_field' =&gt; 'step',
           'maxitems' =&gt; 50,
           'appearance' =&gt; array(
               'collapseAll' =&gt; 1,
               'levelLinksPosition' =&gt; 'top',
               'showSynchronizationLink' =&gt; 1,
               'showPossibleLocalizationRecords' =&gt; 1,
               'showAllLocalizationLink' =&gt; 1
           ),
      ),
  ),
  ...
  </code></pre>
  
  <p>So the positions and step relations were correctly saved into database, but for some reasons I have changed a lot and it is not necessary anymore to create the positions inside the steps because the positions already exists and a user have to select the positions which are necessary. So I changed the inline type to a multi select field:</p>
  
  <pre><code>'positions' =&gt; array(
      'exclude' =&gt; 1,
      'label' =&gt; '...',
      'config' =&gt; array(
          'type' =&gt; 'select',
           'foreign_table' =&gt; 'tx_foxexample_domain_model_position',
           'foreign_table_where' =&gt; 'ORDER BY title ASC',
           'minitems' =&gt; 0,
           'maxitems' =&gt; 50,
      ),
   ),
  </code></pre>
  
  <p>With this changes a user can select the relevant positions for each step, but if I take a look at the database tables I can see that the step field of my positions table is always 0 and the positions field of my step table holds the position uid now. </p>
  
  <p>So I run into some trouble because I can't define a 'foreign_field' for the multi select field, so the relation to the position table is gone. Furthermore I can only add one position because only one position will be saved and the other selected positions will be ignored because only one uid will be stored.</p>
  
  <p>Before save:
  <a href="https://i.stack.imgur.com/LoJtX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LoJtX.png" alt="enter image description here"></a></p>
  
  <p>After save:
  <a href="https://i.stack.imgur.com/NzpMn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NzpMn.png" alt="enter image description here"></a></p>
  
  <p>In summary I want to keep the inline field behaviour for the multi select field. What can I do to keep the inline field behaviour for a multi select field?</p>