<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 5 |
- +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2019 |
- +--------------------------------------------------------------------+
- | This file is a part of CiviCRM. |
- | |
- | CiviCRM is free software; you can copy, modify, and distribute it |
- | under the terms of the GNU Affero General Public License |
- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
- | |
- | CiviCRM is distributed in the hope that it will be useful, but |
- | WITHOUT ANY WARRANTY; without even the implied warranty of |
- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
- | See the GNU Affero General Public License for more details. |
+ | Copyright CiviCRM LLC. All rights reserved. |
| |
- | You should have received a copy of the GNU Affero General Public |
- | License and the CiviCRM Licensing Exception along |
- | with this program; if not, contact CiviCRM LLC |
- | at info[AT]civicrm[DOT]org. If you have questions about the |
- | GNU Affero General Public License or the licensing of CiviCRM, |
- | see the CiviCRM license FAQ at http://civicrm.org/licensing |
+ | This work is published under the GNU AGPLv3 license with some |
+ | permitted exceptions and without any warranty. For full license |
+ | and copyright information, see https://civicrm.org/licensing |
+--------------------------------------------------------------------+
*/
*/
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');
*/
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'];
}
/**
* @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'];
}
*/
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'];
}
/**
list($dao, $query) = _civicrm_api3_get_query_object($params, $mode, 'Pledge');
- $pledge = array();
+ $pledge = [];
while ($dao->fetch()) {
$pledge[$dao->pledge_id] = $query->store($dao);
}
* Set default to not return test params.
*/
function _civicrm_api3_pledge_get_defaults() {
- return array('pledge_test' => 0);
+ return ['pledge_test' => 0];
}
/**