title: CakePHP 3, associated data being saved as new not updating?
body: <h2>UPDATE</h2>
  
  <p>As Requested, this is the <code>$this->request->data</code> thats form my forms,</p>
  
  <pre><code>'office' =&gt; 'LON-test33',
  'phone' =&gt; '456456456',
  'address' =&gt; [
      'addline1' =&gt; '1 test0009 st',
      'addline2' =&gt; 'p09987',
      'addline3' =&gt; 'test9999',
      'postcode' =&gt; 'p888',
      'country_id' =&gt; '226'
  ],
  </code></pre>
  
  <p>So the office, phone are part of my office table, the address is the whole address table.</p>
  
  <p>I have also done a test, to see if it was something in the model, by just trying to update just the address table by suppling it an ID. Which works so I take it my model is fine. So I am thinking either something to do with the Office model or something wrong with my code?</p>
  
  <p>Thanks,</p>
  
  <hr>
  
  <p>So I am using CakePHP 3.0.something ....</p>
  
  <p>I am trying to update my address which is associated data to the office table. However when I update the office, the address is saved as a whole new record? Not sure why?</p>
  
  <p>Here is what I am doing so far,</p>
  
  <pre><code>$OfficeTable = TableRegistry::get('Offices');
  $CurrentOffice = $OfficeTable-&gt;get($OfficeID);
  
  $OfficeTable-&gt;patchEntity($CurrentOffice, $this-&gt;request-&gt;data, ['associated' =&gt; ['Addresses']]);
  
  debug( $OfficeTable-&gt;save($CurrentOffice) );
  </code></pre>
  
  <p>Setting the <code>Associated</code> in the patchEntity seems to make no difference, the updated address is saved, but as a new record. This new records ID is then placed into the Office table in the 'address_id' field. </p>
  
  <p>But why is it adding this 'new/edited' address as a new record and not updating the associated id record?</p>
  
  <p>Now I have been reading the docs, and form what I understand, it will make a new record if it can not find the record? However, I have debugged the save call and on both the office and address there is a '[new]' set to false. So why update my office but make a new address when it is telling me its not new?</p>
  
  <p>So to add, at the bottom of my debug call there is '[original]' which contains the old address id of the record it should of updated.</p>
  
  <p>So what am I doing wrong?</p>
  
  <p><strong>If I have not explained myself right (I am dyslexic), then please let me know or if anything is missing I can update - Thanks</strong></p>