-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace multiple DB transactions with a single one #6315
Conversation
9e9e804
to
3d17c27
Compare
return '_labels' !== $key; | ||
}, ARRAY_FILTER_USE_KEY); | ||
|
||
$singleIdentifierFieldName = $this->modelManager->getIdentifierFieldNames($this->className)[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this wont be correct for composite keys
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, but at the beginning I thought this was occurring with the previous implementation. Checking EntityManager::find()
I see that isn't the case.
I guess we must build a custom query for composite keys, since if we call findBy()
for each key, we have no guarantee about the keys' consistency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I dont know if it is better to delegate that to the persistence bundles, because I dont know if the odm works the same way. Maybe it is better to introduce the findMultiple you mentioned in the issue
Could you please rebase your PR and fix merge conflicts? |
d646fbf
to
f57b683
Compare
I'm currently using the same approach as
We could provide a shortcut |
0b00e04
to
60524d9
Compare
@phansys I re-read again the PR. Do we really need a If not implemented you're using
We could always use this code instead of requiring a new method in the interface which can be fully implemented with others methods. |
I think there is no need for a new method, but the same was also true in the first commit (I guess): d02a65a. |
8aa4cba
to
4ade0b7
Compare
ModelManagerInterface::findBy()
d7597d9
to
3e2b82f
Compare
Sorry @VincentLanglet, I had to fix a CS issue in the new test. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
Thanks ! |
Subject
Replace multiple DB transactions with a single one.
I am targeting this branch, because these changes respect BC.
Closes #6280.
Changelog