Is there an 'update' event logic hook for a module that I could use to fire custom php code whenever a module gets updated with new data?
Thanks!
Is there an 'update' event logic hook for a module that I could use to fire custom php code whenever a module gets updated with new data?
Thanks!
In the before_save you can verify that the $bean->id is empty to see if the record is new, if it's not empty then it's an update.
FrancescaS
Francesca is right on using the before_save logic hook $bean->id to determine if it is a new record or an update to an existing record.
Just to elaborate a bit, you can cache data from the before_save hook and compare it to the after_save hook to determine what fields were actually updated. In this way, you can run specific php code whenever certain fields were updated on the bean.
Hope that helps.
Jon