title: HasMany association on an associated (belongstomany through) Model
body: <p>I'm trying to make this thing work :</p>
  
  <p><code>Orders</code> belongsToMany <code>Products</code> through <code>ProductsOrders</code></p>
  
  <p>ProductsOrders has a composite key (order_id, product_id) - At this point, everything work perfectly.</p>
  
  <p>What I wan is to add a new association (<code>ProductsOrders</code> hasMany <code>Extras</code>) because a product can have a couple of data (sauces, kaking style, drink, ...).</p>
  
  <p>So I've created the <code>Extras</code> model with :</p>
  
  <pre><code>$this-&gt;belongsTo('Orders', [
              'foreignKey' =&gt; 'order_id',
              'joinType' =&gt; 'INNER'
          ]);
  $this-&gt;belongsTo('Products', [
              'foreignKey' =&gt; 'product_id',
              'joinType' =&gt; 'INNER'
          ]);
  </code></pre>
  
  <p>And I added the following in the ProductsOrders model</p>
  
  <pre><code> $this-&gt;hasMany("Extras", [
              'foreignKey' =&gt; [
                  'order_id',
                  'product_id'
              ],
              'bindingKey' =&gt; [
                  'order_id',
                  'product_id'
              ]
          ]);
  </code></pre>
  
  <p>When patching the Order Entity, it seems to be correct : (simplified version)</p>
  
  <pre><code>object(App\Model\Entity\Order) {
      'establishment_id' =&gt; (int) 1,
      'state_id' =&gt; (int) 20,
      'products' =&gt; [
          (int) 0 =&gt; object(App\Model\Entity\Product) {
  
              'id' =&gt; (int) 32,
              'establishment_id' =&gt; (int) 1,
              'category_id' =&gt; (int) 11,
              '_joinData' =&gt; object(App\Model\Entity\OrdersProduct) {
  
                  'quantity' =&gt; (int) 4,
                  'price' =&gt; (float) 9,
                  'extras' =&gt; [
                      (int) 0 =&gt; object(App\Model\Entity\Extra) {
  
                          'title' =&gt; 'Sauces',
                          'choice' =&gt; 'Mayonaise',
                          'price' =&gt; (float) 0,
                          '[new]' =&gt; true,
                          '[accessible]' =&gt; [
                              '*' =&gt; true
                          ],
                          '[dirty]' =&gt; [
                              'title' =&gt; true,
                              'choice' =&gt; true,
                              'price' =&gt; true
                          ],
                          '[original]' =&gt; [],
                          '[virtual]' =&gt; [],
                          '[errors]' =&gt; [],
                          '[invalid]' =&gt; [],
                          '[repository]' =&gt; 'Extras'
  
                      }
                  ],
                  '[new]' =&gt; true,
                  '[accessible]' =&gt; [
                      '*' =&gt; true
                  ],
                  '[dirty]' =&gt; [
                      'quantity' =&gt; true,
                      'price' =&gt; true,
                      'tva' =&gt; true,
                      'extras' =&gt; true
                  ],
                  '[original]' =&gt; [],
                  '[virtual]' =&gt; [],
                  '[errors]' =&gt; [],
                  '[invalid]' =&gt; [],
                  '[repository]' =&gt; 'OrdersProducts'
  
              },
          }
      ]
  }
  </code></pre>
  
  <p>The problem is, when saving (with success), there is no Extras data in table ... That's sad.</p>
  
  <p>Where did I make a mistake ? Or is this still possible ?</p>
  
  <p>Thanks in avdance</p>