title: CakePHP 3.x update multiple rows
body: <p>I have a table AssetsAssignations, with hundreds of rows. In some cases, the user needs to select many rows with a checkbox, and change the "status" for all of them together.</p>
  
  <p>In my controller, I have this function</p>
  
  <pre><code>public function editMultiple()
  {
      $assetStatuses = $this-&gt;AssetsAssignations-&gt;AssetStatuses-&gt;find('list');
      $this-&gt;paginate = [
          'contain' =&gt; ['Assets', 'AssetStatuses', 'Clients', 'Rooms'],
          'sortWhitelist' =&gt; [
              'Assets.model_number',
              'Assets.serial_number',
              'AssetStatuses.name',
              'Clients.last_name',
              'Rooms.name',
              ]
      ];
  
      $assetsAssignations = $this-&gt;request-&gt;data;
  
      $assetsAssignations_ids = array();
  
      foreach($assetsAssignations as $a){
          $assetsAssignations_ids[$a['id']] = $a['id'];
          $this-&gt;AssetsAssignations-&gt;updateAll(
  
              array('AssetAssignation.id' =&gt; $assetsAssignations_ids)
          );
          $this-&gt;Session-&gt;setFlash(__('Statsus is updated for the selcted entries!'));
      }            
      debug($assetsAssignations);
  
      $query = $this-&gt;AssetsAssignations-&gt;find()
          -&gt;contain(['Assets', 'AssetStatuses', 'Clients', 'Rooms']);
      $filter = $this-&gt;Filter-&gt;prg($query);
      $assetsAssignations = $this-&gt;paginate($filter, ['maxLimit' =&gt; 10000, 'limit' =&gt; 10000]);        
  
      $this-&gt;set(compact('assetsAssignations', 'assetStatuses'));
      $this-&gt;set('_serialize', ['assetsAssignations']);
  }
  </code></pre>
  
  <p>In my edit_multiple.ctp, I use a javascript to filter the data. And I put this code:</p>
  
  <pre><code>&lt;table class="hoverTable dataTable"&gt;
          &lt;thead&gt;
                  &lt;tr&gt;
                      &lt;th&gt;Select&lt;/th&gt;&lt;th&gt;Model Number&lt;/th&gt;&lt;th&gt;Serial Number&lt;/th&gt;&lt;th&gt;Room&lt;/th&gt;&lt;th&gt;Client&lt;/th&gt;&lt;th&gt;Status&lt;/th&gt;
                  &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;/thead&gt;
                      &lt;?php foreach ($assetsAssignations as $assetsAssignation): ?&gt;
                      &lt;tr&gt;
                          &lt;td&gt;&lt;input name="data[AssetsAssignations][id][]" value="&lt;?= $assetsAssignation-&gt;id ?&gt;" id="AssetsAssignationsId1" type="checkbox"&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;?= $assetsAssignation-&gt;has('asset') ? $assetsAssignation-&gt;asset-&gt;model_number : '' ?&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;?= $assetsAssignation-&gt;has('asset') ? $assetsAssignation-&gt;asset-&gt;serial_number : '' ?&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;?= $assetsAssignation-&gt;has('room') ? $assetsAssignation-&gt;room-&gt;name : '' ?&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;?= $assetsAssignation-&gt;has('client') ? $assetsAssignation-&gt;client-&gt;last_name . ', ' . $assetsAssignation-&gt;client-&gt;first_name: '' ?&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;?= $assetsAssignation-&gt;has('asset_status') ? $assetsAssignation-&gt;asset_status-&gt;name : '' ?&gt;&lt;/td&gt;
                      &lt;/tr&gt;
                      &lt;?php endforeach; ?&gt;
      &lt;/table&gt;
      &lt;legend&gt;&lt;?= __('') ?&gt;&lt;/legend&gt;
      &lt;/div&gt;
          &lt;?= $this-&gt;Form-&gt;create($assetsAssignation) ?&gt;
      &lt;fieldset&gt;
          &lt;div class="row"&gt;
              &lt;div class="col-xs-3"&gt;&lt;?= $this-&gt;Form-&gt;input('asset_status_id', ['options' =&gt; $assetStatuses, 'empty' =&gt; true, 'label' =&gt; __('Change Status To')]) ?&gt;&lt;/div&gt;
          &lt;/div&gt;
      &lt;/fieldset&gt;
      &lt;?= $this-&gt;Form-&gt;button(__('Submit')) ?&gt;
      &lt;?= $this-&gt;Form-&gt;end() ?&gt;
  </code></pre>
  
  <p>When I debug the result, checking 3 entries, I get this:</p>
  
  <pre><code>[
  'data' =&gt; [
      'AssetsAssignations' =&gt; [
          'id' =&gt; [
              (int) 0 =&gt; '411',
              (int) 1 =&gt; '413',
              (int) 2 =&gt; '415'
          ]
      ]
  ],
  'asset_status_id' =&gt; '3'
  </code></pre>
  
  <p>]</p>
  
  <p>My question is: How to pass the selected row IDs to the "Submit" button after selecting the checkboxes ?</p>
  
  <p>Thanks in advance.</p>