In Doctrine/Symfony3, how would I best check whether a record is about to be changed in order to delete/create a new one instead of updating?
Context: I'm loading a large price list csv into the database every time the supplier sends one. It is important that updated prices are not reflected in previously placed orders. Of course I could soft-delete all objects every time the list is uploaded, and create new ones, but that would make the database unnecessarily large and require unneccessary calls.
Therefore I want to soft-delete an object and create a new one only when it has been changed.