title: CakePHP get matches in an array() based on hasMany relationship
body: <p>PlanDetails hasMany Companies. PlanDetail table has company_id field. </p>
  
  <p>This is all I need to achieve: PlanDetail.company_id = Company.id. So get all Plan Details where PlanDetail.company_id matches Company.id.</p>
  
  <p>Here is the query I have been messing with in the plan_details_controller:</p>
  
  <pre><code>function pd_list_by_company() {
      $this-&gt;PlanDetail-&gt;unbindModel(array('hasMany' =&gt; array('Plan')));
      $comp_id = $this-&gt;PlanDetail-&gt;Company-&gt;find('all');
      $result = $this-&gt;PlanDetails-&gt;find('all', array('conditions' =&gt; array
  ('Company.id' =&gt; 'PlanDetail.company_id')));
      $company_id = $this-&gt;PlanDetail-&gt;read('company_id');
      }
  </code></pre>
  
  <p>I cannot just get the results I need.. what am I doing wrong here?</p>