belongsTo 是属于的关系。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
var $belongsTo = array(

    'Inventory' => array(
        'className'    => 'Inventory',
        'foreignKey' => false,
        'conditions' => array(' `RentalLineitem`.`i_num` = `Inventory`.`i_num`'),
        'dependent'    => false //是否级联删除
    )

);

参考文章:http://stackoverflow.com/questions/6267804/cakephp-mapping-belongsto-association-to-a-non-primary-key