我试图保存IssueHistoryDescription,它属于IssueHistory。 因此IssueHistory有许多历史故事。这一切都在模型中设置。CakePHP:保存相关数据
然而,当我把它保存在IssueHistory,使用$IssueHistory->save($data);
(不管有没有$IssueHistory->create();
前...)
Array ( [IssueHistory] => Array ( [id] => 22 ) [IssueHistoryDescription] => Array ( [old_description] => OLD [description] => NEW ) )
它不工作,没有被保存。
当我尝试使用saveAssociated()
我得到一个错误:
致命错误:无法使用字符串作为/var/www/xdev/kipdomanager/cakephp/lib/Cake/Model/Model.php数组offset上线2248
您可以尝试CakePHP的'白水()'方法... – thecodeparadox