mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Merge is creating not working for children @OneToMany #6104
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @sks40gb on GitHub (Nov 17, 2018).
Merge is creating not working for children @OneToMany
I am using Php Doctrine and I am using
@OnToManymapping withcascadeall. I have a parent classSalesOrderand child classSalesOrderDetails.Case 1 : Save- When I save new record sales order along with sales order details. It is working as expected.Case 2 : Update- Here is the issue, I am merging theSales Orderwhich is fine however its inserting new records for its childrenSalesOrderDetailinstead of updating it. Ideally it should it applymergebut for children as well but its not.As of now, I am getting the Sales Order Details by id from DB then change the properties of it. Ideally that should not be the case, mean if we set the id to unmanned object, it should update instead of creating new records.
Note:
SalesOrder.php
SalesOrderDetail.php