You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to get the old values when overriding preUpdate?
#2057
I need to store all changes (overwritten values) in my tables (80+) to an external database in a specific format. I have overridden the preUpdate function of all my objects, but when i try to get the old values for safekeeping in the external database, I only get the new values. If my preUpdate call returns false, Propel revoke the changes of course, and roll back to the old values. But how can I get hold of these? I have tried both the standard getters and the getByName function. Both returns the new values... And getting the same object by way of create()->findPk() also give me the new values. Due to caching possibly.
I would think that the intuitive way of accessing the old values would be getting the old values prior to returning true in the preUpdate hook, or having a special function for accessing the old values available in preUpdate. I would think being able to read both old AND new values would make perfect sense in the preUpdate hook, actually?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
I need to store all changes (overwritten values) in my tables (80+) to an external database in a specific format. I have overridden the preUpdate function of all my objects, but when i try to get the old values for safekeeping in the external database, I only get the new values. If my preUpdate call returns false, Propel revoke the changes of course, and roll back to the old values. But how can I get hold of these? I have tried both the standard getters and the getByName function. Both returns the new values... And getting the same object by way of create()->findPk() also give me the new values. Due to caching possibly.
I would think that the intuitive way of accessing the old values would be getting the old values prior to returning true in the preUpdate hook, or having a special function for accessing the old values available in preUpdate. I would think being able to read both old AND new values would make perfect sense in the preUpdate hook, actually?
Has anyone got any thoughts or ideas about this?
All reactions