-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Make EntityPersisters tell the UoW about post insert IDs early #10743
Conversation
1dde2cc
to
4ab686f
Compare
} | ||
|
||
/** @group DDC-3470 */ | ||
public function testExecuteInsertsWillReturnEmptySetWithNoQueuedInserts(): void |
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.
This was the only test in here, and it is now meaningless.
I don't see anything wrong with that. Please document the deprecation though. |
eda87a1
to
71755bf
Compare
Added the deprecation in the UPGRADE file |
2201af3
to
f93004c
Compare
lib/Doctrine/ORM/UnitOfWork.php
Outdated
* @param object $entity | ||
* @param mixed $generatedId | ||
*/ | ||
public function assignPostInsertId($entity, $generatedId): void |
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.
Should this method be final
?
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.
IMHO the entire UoW should be final :-)
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.
Even if technically it is not, we should treat it as if it were 😈
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.
fixed
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
Thanks @mpdude ! |
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
void
ok?