我想通過我的模型保存項目,但保存失敗。CakePHP:保存()失敗,但沒有驗證錯誤
當我輸出validationErrors - 我得到空數組,所以沒有驗證問題似乎可用。什麼可能會失敗我的save()
?
function resave($wid, $kTime){
$this->contain();
$word = $this->getById($wid);
// Successfully tretrieved here
$word['ModelName']['column'] = $kTime;
if($this->save($word)){
return 'success';
}else{
// this returns empty array
return $this->validationErrors;
}
}