X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=api%2Fv3%2FPledge.php;h=282aeec92be83b62f392c633aa4a964c2bc1307a;hb=4e74399f10f2aec0901675388388ce2e50786186;hp=f74e0466e4e6236c2a3c3e88b812d7f864124154;hpb=ef444b4a23f83a38d8362eb66cd1b06071a7cd1c;p=civicrm-core.git diff --git a/api/v3/Pledge.php b/api/v3/Pledge.php index f74e0466e4..282aeec92b 100644 --- a/api/v3/Pledge.php +++ b/api/v3/Pledge.php @@ -3,7 +3,7 @@ +--------------------------------------------------------------------+ | CiviCRM version 5 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2017 | + | Copyright CiviCRM LLC (c) 2004-2019 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -55,9 +55,9 @@ function civicrm_api3_pledge_create($params) { */ function civicrm_api3_pledge_delete($params) { if (CRM_Pledge_BAO_Pledge::deletePledge($params['id'])) { - return civicrm_api3_create_success(array( + return civicrm_api3_create_success([ 'id' => $params['id'], - ), $params, 'Pledge', 'delete'); + ], $params, 'Pledge', 'delete'); } else { return civicrm_api3_create_error('Could not delete pledge'); @@ -71,7 +71,7 @@ function civicrm_api3_pledge_delete($params) { */ function _civicrm_api3_pledge_delete_spec(&$params) { // set as not required as pledge_id also acceptable & no either/or std yet - $params['id']['api.aliases'] = array('pledge_id'); + $params['id']['api.aliases'] = ['pledge_id']; } /** @@ -80,15 +80,15 @@ function _civicrm_api3_pledge_delete_spec(&$params) { * @param array $params */ function _civicrm_api3_pledge_get_spec(&$params) { - $params['next_pay_date'] = array( + $params['next_pay_date'] = [ 'name' => 'next_pay_date', 'type' => 12, 'title' => 'Pledge Made', 'api.filter' => 0, 'api.return' => 1, - ); + ]; $params['pledge_is_test']['api.default'] = 0; - $params['pledge_financial_type_id']['api.aliases'] = array('contribution_type_id', 'contribution_type'); + $params['pledge_financial_type_id']['api.aliases'] = ['contribution_type_id', 'contribution_type']; } @@ -99,13 +99,13 @@ function _civicrm_api3_pledge_get_spec(&$params) { */ function _civicrm_api3_pledge_create_spec(&$params) { - $required = array('contact_id', 'amount', 'installments', 'start_date', 'financial_type_id'); + $required = ['contact_id', 'amount', 'installments', 'start_date', 'financial_type_id']; foreach ($required as $required_field) { $params[$required_field]['api.required'] = 1; } // @todo this can come from xml - $params['amount']['api.aliases'] = array('pledge_amount'); - $params['financial_type_id']['api.aliases'] = array('contribution_type_id', 'contribution_type'); + $params['amount']['api.aliases'] = ['pledge_amount']; + $params['financial_type_id']['api.aliases'] = ['contribution_type_id', 'contribution_type']; } /** @@ -122,7 +122,7 @@ function civicrm_api3_pledge_get($params) { list($dao, $query) = _civicrm_api3_get_query_object($params, $mode, 'Pledge'); - $pledge = array(); + $pledge = []; while ($dao->fetch()) { $pledge[$dao->pledge_id] = $query->store($dao); } @@ -134,7 +134,7 @@ function civicrm_api3_pledge_get($params) { * Set default to not return test params. */ function _civicrm_api3_pledge_get_defaults() { - return array('pledge_test' => 0); + return ['pledge_test' => 0]; } /**