mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Persisting Entity with OneToOne relation #7142
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 @jakublabno on GitHub (Apr 28, 2023).
Bug Report
Summary
Invalid parameters binding while persisting new entity with OneToOneRelation
Current behavior
I have two entities:
InvoiceandInvoiceNumerationWhile I'm creating
Invoiceentity, doctrine throws a pdo exceptionWhen checking deeper, it seems id is not being passed to PDO, I see null there.

How to reproduce
Here is DDL:
Of course, everything worked before adding OneToOne and JoinColumn definition.
Maybe I'm doing something wrong?
I would not use JoinColumn, because it seems not be necessary, but when I don't it throws another exception
However, it's the same type as in
InvoiceEntity Id@mpdude commented on GitHub (May 31, 2023):
Thank you for providing a code example! That makes it easier to understand the situation.
As a first step, could you please try to simplify the code a bit more?
DateTimeTrait, and do you need it to show the problem?