Make EntityPersisters tell the UoW about post insert IDs early#10743
Merged
greg0ire merged 1 commit intodoctrine:2.16.xfrom Jun 25, 2023
Merged
Make EntityPersisters tell the UoW about post insert IDs early#10743greg0ire merged 1 commit intodoctrine:2.16.xfrom
greg0ire merged 1 commit intodoctrine:2.16.xfrom
Conversation
1dde2cc to
4ab686f
Compare
mpdude
commented
Jun 2, 2023
| } | ||
|
|
||
| /** @group DDC-3470 */ | ||
| public function testExecuteInsertsWillReturnEmptySetWithNoQueuedInserts(): void |
Contributor
Author
There was a problem hiding this comment.
This was the only test in here, and it is now meaningless.
Member
I don't see anything wrong with that. Please document the deprecation though. |
eda87a1 to
71755bf
Compare
Contributor
Author
|
Added the deprecation in the UPGRADE file |
2201af3 to
f93004c
Compare
greg0ire
reviewed
Jun 22, 2023
lib/Doctrine/ORM/UnitOfWork.php
Outdated
| * @param object $entity | ||
| * @param mixed $generatedId | ||
| */ | ||
| public function assignPostInsertId($entity, $generatedId): void |
Contributor
Author
There was a problem hiding this comment.
IMHO the entire UoW should be final :-)
Contributor
Author
There was a problem hiding this comment.
Even if technically it is not, we should treat it as if it were 😈
This refactoring does two things: * We can avoid collecting the post insert IDs in a cumbersome array structure that will be returned by the EntityPersisters and processed by the UoW right after. Instead, use a more expressive API: Make the EntityPersisters tell the UoW about the IDs immediately. * IDs will be available in inserted entities a tad sooner. That may help to resolve doctrine#10735, where we can use the IDs to skip extra updates.
f93004c to
8bc74c6
Compare
greg0ire
approved these changes
Jun 25, 2023
SenseException
approved these changes
Jun 25, 2023
Member
|
Thanks @mpdude ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This refactoring does two things:
Reviewers: Is the way I implemented the deprecation that EntityPersisters shall no longer return these arrays and change their return type to
voidok?