Bin will be removed on June 1, 2014 in favor of http://gist.github.com. Please save all your pastes before then. So long, and thanks for all the fish!×
1
2
3
4
5
6
7
8
9
10
11
12
13
$this->Employee->Requirement->bindModel(array('hasOne'=>array('CostunitsRequirement')));
$requirements = $this->Employee->Requirement->find('all', array(
    'contain'=>array('Costunit'),
    'conditions'=>array(
        'CostunitsRequirement.costunit_id'=>3
    ),
));
 
 
// Throws the following error:
Warning (512): SQL Error: 1054: Unknown column 'CostunitsRequirement.costunit_id' in 'where clause' [CORE/cake/libs/model/datasources/dbo_source.php, line 525]
 
Query: SELECT `Requirement`.`id`, `Requirement`.`title`, `Requirement`.`desc` FROM `requirements` AS `Requirement` WHERE `CostunitsRequirement`.`costunit_id` = 3