title: Sql query to cakephp query using associations
body: <p>Here is my correct sql query:</p>
  
  <pre><code>SELECT * FROM `messages` WHERE ( (sender_id=3 AND user_id=40) OR (sender_id=40 AND user_id=3)) AND offer_id=1
  </code></pre>
  
  <p>I want to use this in Cakephp syntax:</p>
  
  <pre><code>$this-&gt;Message-&gt;find('all',array('conditions'=&gt;array(
  
                  'AND'=&gt;array(
                      'OR'=&gt;array(
                          'Message.offer_id'=&gt;$offer_id,
                          'Message.sender_id'=&gt;$sender_id,
                          'Message.user_id'=&gt;$this-&gt;Auth-&gt;user('id'),
                      ),
                      'OR'=&gt;array(
                          'Message.offer_id'=&gt;$offer_id,
                          'Message.user_id'=&gt;$sender_id,
                          'Message.sender_id'=&gt;$this-&gt;Auth-&gt;user('id')
                      )
                  )
  
  
                  ),
                  'recursive'=&gt;2
                  ));
  </code></pre>
  
  <p>Is there anyone who can help me to figure out the issue. Basically I want to get all the messages whether I sent or received for an particular offer.</p>