CRM-21052 - Activity.create API - Abide by setting `civicaseActivityRevisions`
[civicrm-core.git] / api / v3 / ContributionSoft.php
index 30b7a46e68205d6f00a0626336f0b1140938365d..5c4daf3a94ad94ed7aadf6e77cbe687751b8b3e8 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2016                                |
+ | Copyright CiviCRM LLC (c) 2004-2017                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -62,14 +62,14 @@ function _civicrm_api3_contribution_soft_create_spec(&$params) {
  * Deletes an existing Soft Credit.
  *
  * @param array $params
+ *
+ * @return array
+ *   Api formatted result.
+ *
+ * @throws API_Exception
  */
 function civicrm_api3_contribution_soft_delete($params) {
-  // Non standard BAO - we have to write custom code to cope.
-  $result = CRM_Contribute_BAO_ContributionSoft::del(array('id' => $params['id']));
-  if (!$result) {
-    throw new API_Exception('Cannot delete contributionSoft ' . $params['id']);
-  }
-  civicrm_api3_create_success(TRUE);
+  return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
 }
 
 /**