-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fatal Error in Custom Finder Method #3950
Comments
I have no primary key defined in VolunteersVolunteerTypesTable because it is a join table:
vendor\cakephp\cakephp\src\ORM\Table.php Line: 1239
|
Adding a primary key to the table made the error go away. But as a hasMany join table that id won't be unique. How can I solve this? |
All tables need a primary key. You can use composite primary keys in 3.0. The error isn't very helpful, and it would be better if the ORM raised an exception when a table had no primary key and you attempted to save a record. |
If we don't have a primary key we cannot safely insert/update records. Refs cakephp#3950
Closing as there is an open pull request now. |
Custom Finder Method
The text was updated successfully, but these errors were encountered: