title: How to find by conditions in two joining tables in CakePHP
body: <p>In my CakePHP app I have three tables: </p>
  
  <p><code>Businesses</code>, <code>Towns</code> and <code>Categories</code>. </p>
  
  <p>A business can belong to multiple towns and multiple categories so I have created joining tables and <code>hasMany</code> and <code>belongsTo</code> relationships. Everything works fine when finding businesses by either Town or Category by using the Town or Category model to search, but I am completely stuck when I want to search for businesses in a certain town AND a certain category, eg. Plumbers in London. </p>
  
  <p>The associations just don't seem to work when searching with the Business model and I get <code>column not found</code> errors when trying to use the associated tables. I would think that this would be along the lines of what needs to be done, but I can't get it to work:</p>
  
  <pre><code>$this-&gt;set('listings', $this-&gt;Business-&gt;find('all', array(
      'conditions' =&gt; array(
          'Business.approved' =&gt; 1,
          'BusinessesCategory.category_id' =&gt; $id,
          'BusinessesTown.town_id' =&gt; $town_id,
          'Business.sasite' =&gt; 1
  )
  </code></pre>