I am trying to save a new record from form data in cakephp4. This code worked in cakephp3.2 and has been updated but doesnt work. My issue is that I just get returned false? I cant do much with a 'false' when i try to save . I tried getErrors on $tutor which wasnt recognized either. How do I find out where the error is?
$tutor = $this->Tutors->newEmptyEntity();
$tutor = $this->Tutors->patchEntity($tutor,$saveData,
[
'associated' => [
'AvailabilityForTutors'=>["validate"=>false],
'AvailabilityForAssessments'=>["validate"=>false],
'Subjects'=>["validate"=>false]
],
"validate"=>false
]);
// debug($tutor);
$tutor = $this->Tutors->save($tutor,[
'validate' => false,
'associated' => [
'AvailabilityForTutors',
'AvailabilityForAssessments',
'Subjects'
]
]);
debug($tutor);//returns false? this doesnt tell me anything
https://book.cakephp.org/4/en/orm/saving-data.html
question from:
https://stackoverflow.com/questions/66056417/cant-find-the-error-on-save-record-in-cakephp4 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…