Answer the question
In order to leave comments, you need to log in
Doctrine: how to get initial state of ManyToMany Collection field?
I do object changes logging using Doctrine.
For simple fields, everything is simple, I use UnitOfWork::getEntityChangeSet
But if the field contains a collection of objects, then I can not find the opportunity to compare the original value of the field with the state during postUpdate.
I found the methods UnitOfWork::getScheduledCollectionDeletions and UnitOfWork::getScheduledCollectionUpdates
But through them I can only get direct changes that will be written to the database, there is no diff there, as in changeSet.
Tell me where to dig, is there something ready for such cases in Doctrine ORM? How to make a decision yourself - I did not find a simple way, only perversions come to mind ...
Thank you.
Answer the question
In order to leave comments, you need to log in
In our project we use https://packagist.org/packages/simplethings/entity...
We set up which entities to monitor, the bundle itself saves everything, then we only look at the history
But if the field contains a collection of objects, then I can not find the opportunity to compare the original value of the field with the state during postUpdate.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question