title: Manipulating Order of JOINS in CakePHP
body: <p>I have the following problem with CakePHP:</p>
  
  <p>In my model, Deposit belongsTo Account, and Account belongsTo Customer.  </p>
  
  <p>When querying Deposits, I get the Account information, but not the Customer's, by default.  </p>
  
  <p>If I set Deposit->recursive to 2, I get the Customer information (and a whole lot more), but CakePHP esentially throws one SELECT per each deposit, which is quite bad in this case.</p>
  
  <p>So, I did this:</p>
  
  <pre><code>'joins' =&gt; array(
      array('table'=&gt;'customers', 'alias'=&gt;'Customer', 'type'=&gt;'left', 'foreignKey' =&gt; false, 'conditions'=&gt;array('Account.customer_id = Customer.id'))
  )
  </code></pre>
  
  <p>which <em>almost</em> works...</p>
  
  <p>What I get from that is esentially:</p>
  
  <pre><code>SELECT (...) FROM Deposits LEFT JOIN Customers LEFT JOIN Accounts
  </code></pre>
  
  <p>instead of </p>
  
  <pre><code>SELECT (...) FROM Deposits LEFT JOIN Accounts LEFT JOIN Customers
  </code></pre>
  
  <p>which of course doesn't work.</p>
  
  <p>Is there anyway to specify that "my custom joins" should go after the "regular model joins"?<br>
  Or do I have to manually unbind Deposit from Account, and specify both joins manually?</p>
  
  <p>Thanks!<br>
  Daniel</p>