projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
api/v3/Cxn - Tweak error
[civicrm-core.git]
/
api
/
v3
/
ContributionRecur.php
diff --git
a/api/v3/ContributionRecur.php
b/api/v3/ContributionRecur.php
index ae5f7a21cc10e13683307046a1860629b6e51580..2db4c8dc3c5d00eda3700dc95cc6e191df57f241 100644
(file)
--- a/
api/v3/ContributionRecur.php
+++ b/
api/v3/ContributionRecur.php
@@
-1,9
+1,9
@@
<?php
/*
+--------------------------------------------------------------------+
<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.
5
|
+ | CiviCRM version 4.
6
|
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-201
4
|
+ | Copyright CiviCRM LLC (c) 2004-201
5
|
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
@@
-26,33
+26,31
@@
*/
/**
*/
/**
- *
File for the CiviCRM APIv3 group functions
+ *
This api exposes CiviCRM recurring contributions.
*
* @package CiviCRM_APIv3
*
* @package CiviCRM_APIv3
- * @subpackage API_ContributionRecur
- * @copyright CiviCRM LLC (c) 2004-2014
*/
/**
*/
/**
- * Create or update a
contribution_recur
+ * Create or update a
ContributionRecur.
*
*
- * @param array $params Associative array of property
- * name/value pairs to insert in new 'contribution_recur'
- * @example ContributionRecurCreate.php Std Create example
+ * @param array $params
+ * Array per getfields metadata.
*
*
- * @return array api result array
- * {@getfields contribution_recur_create}
- * @access public
+ * @return array
+ * api result array
*/
function civicrm_api3_contribution_recur_create($params) {
return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
}
/**
*/
function civicrm_api3_contribution_recur_create($params) {
return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
}
/**
- * Adjust Metadata for Create action
+ * Adjust Metadata for Create action
.
*
*
- * The metadata is used for setting defaults, documentation & validation
- * @param array $params array or parameters determined by getfields
+ * The metadata is used for setting defaults, documentation & validation.
+ *
+ * @param array $params
+ * Array of parameters determined by getfields.
*/
function _civicrm_api3_contribution_recur_create_spec(&$params) {
$params['contact_id']['api.required'] = 1;
*/
function _civicrm_api3_contribution_recur_create_spec(&$params) {
$params['contact_id']['api.required'] = 1;
@@
-62,46
+60,42
@@
function _civicrm_api3_contribution_recur_create_spec(&$params) {
}
/**
}
/**
- * Returns array of contribution_recurs
matching a set of one or more group properties
+ * Returns array of contribution_recurs
matching a set of one or more group properties.
*
*
- * @param array $params (referance) Array of one or more valid
- * property_name=>value pairs. If $params is set
- * as null, all contribution_recurs will be returned
+ * @param array $params
+ * Array of properties. If empty, all records will be returned.
*
*
- * @return array (referance) Array of matching contribution_recurs
- * {@getfields contribution_recur_get}
- * @access public
+ * @return array
+ * API result Array of matching contribution_recurs
*/
function civicrm_api3_contribution_recur_get($params) {
return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
}
/**
*/
function civicrm_api3_contribution_recur_get($params) {
return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
}
/**
- * Cancel a recurring contribution of existing
contribution_recur.id
+ * Cancel a recurring contribution of existing
ContributionRecur given its id.
*
*
- * @param array $params (reference) array containing id of the recurring contribution
+ * @param array $params
+ * Array containing id of the recurring contribution.
*
*
- * @return boolean returns true is successfully cancelled
+ * @return bool
+ * returns true is successfully cancelled
*/
*/
-
function civicrm_api3_contribution_recur_cancel($params) {
civicrm_api3_verify_one_mandatory($params, NULL, array('id'));
function civicrm_api3_contribution_recur_cancel($params) {
civicrm_api3_verify_one_mandatory($params, NULL, array('id'));
- return
call_user_func_array(array(_civicrm_api3_get_BAO(__FUNCTION__), 'cancelRecurContribution'), array($params['id'], CRM_Core_DAO::$_nullObject
));
+ return
CRM_Contribute_BAO_ContributionRecur::cancelRecurContribution($params['id'], CRM_Core_DAO::$_nullObject) ? civicrm_api3_create_success() : civicrm_api3_create_error(ts('Error while cancelling recurring contribution'
));
}
/**
}
/**
- *
delete an existing contribution_recur
+ *
Delete an existing ContributionRecur.
*
*
- * This method is used to delete any existing contribution_recur. id of the group
- * to be deleted is required field in $params array
+ * This method is used to delete an existing ContributionRecur given its id.
*
*
- * @param array $params
(reference) array containing id of the group
- *
to be deleted
+ * @param array $params
+ *
[id]
*
*
- * @return array (referance) returns flag true if successfull, error
- * message otherwise
- * {@getfields contribution_recur_delete}
- * @access public
+ * @return array
+ * API result array
*/
function civicrm_api3_contribution_recur_delete($params) {
return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
*/
function civicrm_api3_contribution_recur_delete($params) {
return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);