创建关系的用途是什么
var $belongsTo = array(
'UserType' => array(
'className' => 'UserType',
'foreignKey' => 'user_type_id',
'conditions' => '',
'fields' => '',
'order' => ''
)
);
//The Associations below have been created with all possible keys, those that are not needed can be removed
var $hasMany = array(
'UserOpenid' => array(
'className' => 'UserOpenid',
'foreignKey' => 'user_id',
'dependent' => true)
);
如果我在“hasMany”中添加了一个以“belongsTo”意义创建的表格怎么办?发生任何错误。cake 如何使用模型中指定的关系?