PlanDetails hasMany Companies. PlanDetail table has company\_id field. 

This is all I need to achieve: PlanDetail.company\_id = Company.id. So get all Plan Details where PlanDetail.company\_id matches Company.id.

Here is the query I have been messing with in the plan\_details\_controller:

```
function pd_list_by_company() {
    $this->PlanDetail->unbindModel(array('hasMany' => array('Plan')));
    $comp_id = $this->PlanDetail->Company->find('all');
    $result = $this->PlanDetails->find('all', array('conditions' => array
('Company.id' => 'PlanDetail.company_id')));
    $company_id = $this->PlanDetail->read('company_id');
    }

```

I cannot just get the results I need.. what am I doing wrong here?