X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=api%2Fv3%2FMembership.php;h=cf926cc8e7335f14443eb6ecf18151b1d85753ec;hb=1839cd10f5523577879c1a329f3f2438af0463e3;hp=fa1952599a983ddecd9d9b2827d8e9123a482196;hpb=3524be8440a54d4da42ee0d768ea0a8d9c309395;p=civicrm-core.git diff --git a/api/v3/Membership.php b/api/v3/Membership.php index fa1952599a..cf926cc8e7 100644 --- a/api/v3/Membership.php +++ b/api/v3/Membership.php @@ -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. | | | @@ -54,9 +54,8 @@ function _civicrm_api3_membership_delete_spec(&$params) { * * @param array $params * Array array holding id - Id of the contact membership to be deleted. - * - * @return array - * API result array. + * @return array API result array. + * @throws API_Exception */ function civicrm_api3_membership_delete($params) { if (isset($params['preserve_contribution'])) { @@ -136,6 +135,7 @@ function civicrm_api3_membership_create($params) { $ids['userId'] = $params['contact_id']; } //for edit membership id should be present + // probably not required now. if (!empty($params['id'])) { $ids['membership'] = $params['id']; $action = CRM_Core_Action::UPDATE; @@ -143,10 +143,6 @@ function civicrm_api3_membership_create($params) { //need to pass action to handle related memberships. $params['action'] = $action; - if (empty($params['line_item']) && !empty($params['membership_type_id'])) { - CRM_Price_BAO_LineItem::getLineItemArray($params, NULL, 'membership', $params['membership_type_id']); - } - $membershipBAO = CRM_Member_BAO_Membership::create($params, $ids, TRUE); if (array_key_exists('is_error', $membershipBAO)) {