Closed pavelkovar closed 6 years ago
Hi, thank you for the detailed bug-report! I will take a closer look soon. In the mean time you may try dev-master. I think I've already fixed this, it's not only released in stable version: https://github.com/nextras/orm/commit/64ed252c30cef247519803dd7131db264aaf6fa2
Hi, unfortunately it doesn't work even on dev-master. Incorrect behavior is caused by this line since result of getPersistedId is ordered by entity properties and result of getStoragePrimaryKey is ordered by columns in database storage.
Thanks for checking it. I will fix it this week.
Fixed, thanks a lot. https://github.com/nextras/orm/commit/bad39470bcf690627e4179f9f29d8b67475bca32
For example we have table _user_tocourse with attributes: _userid, _courseid and _roleid, and entity:
Then code snippet:
fails with exception:
When I change order of entity properties to match order of attributes in database storage then everything works as expected.