我有模型的PatientCase和Procedure。一个案例可以有一个/多个程序。CakePHP所属关系不保存
class PatientCase extends AppModel {
public $hasMany = 'Procedure';
}
class Procedure extends AppModel {
public $belongsTo = array(
'PatientCase' => array(
'className' => 'PatientCase'
)
);
}
我明确地在我patientCasesController
$this->request->data["Procedure"]["side"] = 'left';
当我白水我patientCase设定的值,案件正确保存,和一个新的记录被保存在程序表,与相应的patientCase id,但是,没有其他数据保存在记录中。
任何人都可以看到我要去哪里错了吗?
你可以分享你节约的代码吗? – 2013-03-01 16:04:05
$ this-> PatientCase-> saveAll($ this-> request-> data) – user195257 2013-03-01 16:23:44