Closed IonBazan closed 1 year ago
@garak I think this is now ready to go - just the PHPStan errors needs some fixing but most of it doesn't seem to be related to this PR itself.
Unfortunately, this AdapterInterface
change is mandatory:
getObjectFromArgs()
was removed because we can rely on getObject()
on the event itself so the method becomes obsoletegetChangeSet()
was introduced to provide an adapter between MongoDB ODM (getDocumentChangeSet()
) and ORM (getEntityChangeSet()
) which is the core of the issue solved by this PRIf we really don't want to touch the interface, we could shift this logic to the listener itself but that would defeat the purpose of using the adapter, especially that the adapter is marked as @internal
since v1.19.0.
I will take a look at PHPStan errors again and solve them in next commit 👍🏻
@IonBazan I'm not against the interface change, but this PR should include an update to changelog
Any news?
@garak sorry, I think the issue that this PR was initially trying to fix has been solved in v1.19.1. I will rebase it and simplify the interface changes then.
@garak I think this is now ready for a review again. Let me know if the changes still make sense after the changes from v1.19.
I've also added some UPGRADING.md
notes to highlight the changes in AdapterInterface
.
Do you mind proposing the same changes on the master branch?
This PR tries to fix the entity/document listeners by:
Doctrine\Persistence
eventsgetObject()
from the event itself instead of using Adapter ~- AddinggetChangeSet()
to the adapter itself so it can be customized~The MongoDB ODM part is a bit poorly tested as many classes are
final
which makes it really difficult to test.