Trying to not do the after_save hook if a bean is modify by a relationship update

Idea created by Uruz Uruz on Oct 29, 2015
    • Uruz Uruz

    after each modification we send bean to a distant service ( account / contact ), only the data not all relationship linked.

    If we do an update to the related bean, for example delete the relationship between the account in a note, the account bean's is "updated".
    Each update of a related field send an object with no update because we don't send relationship to the distant service.

    I think to use $arguments['dataChanges'] in the logic hook , to compare with a predefined list if one of  $arguments['dataChanges'] field's  is modify in order to know if we need to synchronize the object or not .

    sample :
    class CallDistantServicesHook { 
    function pushDataToDistantServices(&$bean, $event, $arguments) {  if (DataHelper::dataChanges($arguments['dataChanges'])) {  // if DataHelper::datachanges return true  // do the api call

    I Hope i'll be clear :)
    I Would like to know if you have a better idea or do something like that.