title: Saving with HABTM in CakePHP
body: <p>I am creating multiple associations in one go and there are a few problems when it comes to saving.</p>
  
  <p>I have the following code:</p>
  
  <pre><code>&lt;?php
  foreach($userData as $user) {
      $data = array('User' =&gt; array('id' =&gt; $user['id']), 'Site' =&gt; array('id' =&gt; $user['site_id']));
      $this-&gt;User-&gt;save($data);
  }
  ?&gt;
  </code></pre>
  
  <p>I have experimented with formatting the data array in different ways although I always encounter the same problems. Either the previous entries get moved when a new one is inserted or the current one gets updated.</p>
  
  <p>I could just use the following although I need a behavior to trigger.</p>
  
  <pre><code>$this-&gt;User-&gt;SiteUser-&gt;save($data);
  </code></pre>
  
  <p>Edit: Also $this->User->create(); doesn't seem to do much.</p>