title: cakephp 3.x saving multiple entities - newEntities
body: <p>I'm having the hardest time with saving multiple records. I've tried a million things, but I end up with the same problem: my records are not saved and I can't see any errors. Bear in mind that I'm new to cakephp and a novice coder.</p>
  
  <p>Am I missing something obvious and crucial?</p>
  
  <p>Table:</p>
  
  <pre><code>    $this-&gt;table('splits');
      $this-&gt;displayField('id');
      $this-&gt;primaryKey('id');
  
      $this-&gt;belongsTo('Transactions', [
          'foreignKey' =&gt; 'transaction_id',
          'joinType' =&gt; 'INNER'
      ]);
      $this-&gt;belongsTo('Accounts', [
          'foreignKey' =&gt; 'account_credit_id',
          'joinType' =&gt; 'INNER'
      ]);
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>    $splits = $this-&gt;Splits-&gt;newEntity();
      if ($this-&gt;request-&gt;is('post')) {
          $splits = $this-&gt;Splits-&gt;newEntities($this-&gt;request-&gt;data());
  
          debug($splits);
  
          foreach ($splits as $split){
              $this-&gt;Splits-&gt;save($split);
          }
     }
  
      $transactions = $this-&gt;Splits-&gt;Transactions-&gt;find('list', ['limit' =&gt; 200]);
      $accounts = $this-&gt;Splits-&gt;Accounts-&gt;find('list', ['limit' =&gt; 200]);
      $this-&gt;set(compact('split', 'transactions', 'accounts'));
      $this-&gt;set('_serialize', ['split']);
  </code></pre>
  
  <p>Template:</p>
  
  <pre><code>        echo $this-&gt;Form-&gt;input('Splits.1.transaction_id', ['options' =&gt; $transactions]);
          echo $this-&gt;Form-&gt;input('Splits.1.amount',  ['type' =&gt; 'float']);
          echo $this-&gt;Form-&gt;input('Splits.1.account_id', ['options' =&gt; $accounts]);
          echo $this-&gt;Form-&gt;input('Splits.2.transaction_id', ['options' =&gt; $transactions]);
          echo $this-&gt;Form-&gt;input('Splits.2.amount',  ['type' =&gt; 'float']);
          echo $this-&gt;Form-&gt;input('Splits.2.account_id', ['options' =&gt; $accounts]);
          echo $this-&gt;Form-&gt;input('Splits.3.transaction_id', ['options' =&gt; $transactions]);
          echo $this-&gt;Form-&gt;input('Splits.3.amount',  ['type' =&gt; 'float']);
          echo $this-&gt;Form-&gt;input('Splits.3.account_id', ['options' =&gt; $accounts]);
  </code></pre>
  
  <p>Debug on $splits:</p>
  
  <pre><code>[
  (int) 0 =&gt; object(App\Model\Entity\Split) {
  
      (int) 1 =&gt; [
          'transaction_id' =&gt; '108',
          'amount' =&gt; '100.33',
          'account_id' =&gt; '2'
      ],
      (int) 2 =&gt; [
          'transaction_id' =&gt; '108',
          'amount' =&gt; '50.22',
          'account_id' =&gt; '4'
      ],
      (int) 3 =&gt; [
          'transaction_id' =&gt; '108',
          'amount' =&gt; '65.22',
          'account_id' =&gt; '5'
      ],
      '[new]' =&gt; true,
      '[accessible]' =&gt; [
          '*' =&gt; true
      ],
      '[dirty]' =&gt; [
          (int) 1 =&gt; true,
          (int) 2 =&gt; true,
          (int) 3 =&gt; true
      ],
      '[original]' =&gt; [],
      '[virtual]' =&gt; [],
      '[errors]' =&gt; [],
      '[repository]' =&gt; 'Splits'
  
  }
  ]
  </code></pre>