title: CakePHP saveAll update or insert related data
body: <p>I'm relatively new with CakePHP and i'm trying to save some related data.</p>
  
  <p>Right now I have an messages database and an users database and I'd like to save the user that send the message in the users table, but this users could already be there if they send multiple messages.</p>
  
  <p>Right now I'm updating like this:</p>
  
  <pre><code>$this-&gt;Message-&gt;saveAll(array(
      'Message' =&gt; array(
          'contents' =&gt; $contents,
      ),
     'User' =&gt; array(
          'name' =&gt; $name,
          'email' =&gt; $email,
      )
  );
  </code></pre>
  
  <p>However this causes mysql to throw an error because CakePHP tries to insert the user as if it is new, but the email already exists and should be unique.</p>
  
  <p>Is there any way to do this? Or should I check if the user already exists myself?</p>
  
  <p>TIA.</p>