diff --git a/CRM/Contribute/BAO/ContributionSoft.php b/CRM/Contribute/BAO/ContributionSoft.php index a949c49a0f7d..c98c5ccd1182 100644 --- a/CRM/Contribute/BAO/ContributionSoft.php +++ b/CRM/Contribute/BAO/ContributionSoft.php @@ -33,6 +33,9 @@ public function __construct() { * soft contribution of object that is added */ public static function add(&$params) { + $hook = empty($params['id']) ? 'create' : 'edit'; + CRM_Utils_Hook::pre($hook, 'ContributionSoft', CRM_Utils_Array::value('id', $params), $params); + $contributionSoft = new CRM_Contribute_DAO_ContributionSoft(); $contributionSoft->copyValues($params); @@ -41,7 +44,9 @@ public static function add(&$params) { $config = CRM_Core_Config::singleton(); $contributionSoft->currency = $config->defaultCurrency; } - return $contributionSoft->save(); + $result = $contributionSoft->save(); + CRM_Utils_Hook::post($hook, 'ContributionSoft', $contributionSoft->id, $contributionSoft); + return $result; } /**