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!
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
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