title: CakePHP - Find parent based on child
body: <p>I have three tables companies, products and prices.</p>
  
  <pre><code>Companies hasMany Products
  Products hasMany Prices
  </code></pre>
  
  <p>I'm currently trying to search these tables for products that are less than a certain price, the code I'm trying is:</p>
  
  <pre><code>$results = $this-&gt;Product-&gt;find('all', array(
      'conditions' =&gt; array(
          'Price.price &lt;=' 10
      )
  ));
  </code></pre>
  
  <p>For some reason using this code cakephp this brings back an error:</p>
  
  <pre><code>Unknown column 'Price.price' in 'where clause'
  </code></pre>
  
  <p>I think this is because products have multiple prices (it's joining with the companies table not the prices table), can anyone tell me why this is going wrong and know how to get it working?</p>
  
  <p><strong>Note</strong>: After getting this working, I want to be able to find products based on criteria from the prices and products tables, then display data from all 3 in a results page.</p>
  
  <p>I thought about first searching the prices table and then searching the products table, but I believe there must be a more efficient way?</p>