mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
OneToMany dependent property is being persisted in the reverse order #5497
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 @christopher-francisco on GitHub (Apr 11, 2017).
Originally assigned to: @Ocramius on GitHub.
I have an entity
OrderandItemas a1:N(this is an example, I know in reality it'd be N:M).I'm using the following method to add items to an order:
The problem is the items are being persisted in the order
$item3, $item2, $item1rather than1,2,3.How can I solve this?
@Ocramius commented on GitHub (Apr 11, 2017):
You can't: there is no guarantee on persistence order here, as long as it
is valid. If you need an incremental sequence, then add one to your code,
and do not rely on auto-incremental identifiers here.
On 11 Apr 2017 4:16 p.m., "Christopher Francisco" notifications@github.com
wrote:
@Ocramius commented on GitHub (Apr 11, 2017):
Closing as
can't fix,invalid