Package DE_EPAGES::RemoteSearch::API::AttributeModifiedCheck
Helper for testing for attribute modifications.
Base |
Exporter |
@EXPORT_OK |
Functions
RunIfModified
Check if at least one attribute is about to be changed. If yes, run the closure sub. This can be used in a BeforeUpdate Hook listener, to filter for relevant changes.
Syntax |
RunIfModified( $Object, $aAttributes, $hNewValues, $LanguageID, $aTypes, $cSub ); |
Example |
# hook listener (API_BeforeUpdateProductPrice) sub OnBeforeUpdateProductPrice { my ($hInfo) = @_; RunIfModified( sub { GetInfoProductPrice($hInfo->{'ProductID}, $hInfo->{'CurrencyID'} ) }, ['ListPrice'], $hInfo, undef, ['Money'], sub { BatchUpdateProduct(LoadObject($hInfo->{'ProductID'})) } ); } |
Input |
|