CakePHP 3 Saving BelongsToMany Association Unknown type “” Error

烈酒焚心 提交于 2019-12-05 17:43:42

Looks like something is wrong with either the read/cached schema, or you are defining an incorrect primary key for the join table class. With a compound primary key like the one you are showing here, it should never reach the point in code where that excpetion is thrown.

Delete tmp/cache/models/, and in case you have a EmailsGuestsTable class, check if and what it sets via Table::primaryKey(), in case used, it should be

['email_id', 'guest_id']

Maybe your table initially had a different primary key, and you've made changes to it afterwards without clearing the cache and/or updating the corresponding table class.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!