CRM-13067 preparatory tidy-up on membership-payment api
authoreileen <eileen@fuzion.co.nz>
Sat, 3 Aug 2013 23:40:35 +0000 (11:40 +1200)
committereileen <eileen@fuzion.co.nz>
Sun, 4 Aug 2013 07:25:34 +0000 (19:25 +1200)
CRM-13067 preparatory tidy-up on membership-payment api

api/v3/MembershipPayment.php

index b4332ac813c03269b7a03e7ef66cca1f49fe6a62..394e4e7c2107e68c6ed5e09a6a2d7dce6dca14a7 100644 (file)
  * @access public
  */
 function civicrm_api3_membership_payment_create($params) {
-
-  $transaction = new CRM_Core_Transaction();
-
-
-  $mpDAO = new CRM_Member_DAO_MembershipPayment();
-  $mpDAO->copyValues($params);
-  $result = $mpDAO->save();
-
-  if (is_a($result, 'CRM_Core_Error')) {
-    $transaction->rollback();
-    return civicrm_api3_create_error($result->_errors[0]['message']);
-  }
-
-  $transaction->commit();
-
-  _civicrm_api3_object_to_array($mpDAO, $mpArray[$mpDAO->id]);
-
-  return civicrm_api3_create_success($mpArray, $params);
+  return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
 }
 
 /**
@@ -90,8 +73,6 @@ function _civicrm_api3_membership_payment_create_spec(&$params) {
  * @access public
  */
 function civicrm_api3_membership_payment_get($params) {
-
-
   return _civicrm_api3_basic_get('CRM_Member_DAO_MembershipPayment', $params);
 }