Replacement for getPartialReference to insert entities with foreign keys without loading the foreign entity first #11118
Unanswered
AnnaDamm
asked this question in
Support Questions
Replies: 1 comment
-
If I understand correctly you should be able to use |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
since the latest version,
getPartialReference
is deprecated.My usecase currently is this:
Because partial reference is deprecated, the new code would look like this:
But that causes an unnecessary database query, just because i need a User object in the Changelog entity. Just using
->setUser((new User)->setId(1))
would tell doctrine to try to insert a new user entity and end in a duplicate key error.Is there a real replacement for this usecase?
Thank you for your help!
Beta Was this translation helpful? Give feedback.
All reactions