M
M
Maxim Lagoysky2019-10-15 18:10:19
symfony
Maxim Lagoysky, 2019-10-15 18:10:19

Why is there a duplicate record error when updating an entity?

Hello. There are 3 entities with a Many to One relationship. In my case, this is the User, Ticket, TicketAssignedUser entity. The TicketAssignedUser entity has only 2 columns, ticket_id and user_id. This entity has a composite primary key of ticket_id and user_id. There is such a problem if TicketAssignedUser has 2 records, then when updating one record, delete and save it, an error will fly out that the record we left has duplicate options 'allow_add' => true, 'allow_delete' => true, 'by_reference' => false are worth . The most interesting thing is that if you add an auto-increment, then everything works like a clock. Is there a way to fix this or do I have to add an auto-increment id field?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question