projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
CRM-16019 - Expose date/time format preferences to clientside
[civicrm-core.git]
/
api
/
v3
/
Pledge.php
diff --git
a/api/v3/Pledge.php
b/api/v3/Pledge.php
index c5b0e357549321d9380b25fa52f3caaca479b25a..eb5949599c312304c2432dd14ad7a08a3bfa3e7f 100644
(file)
--- a/
api/v3/Pledge.php
+++ b/
api/v3/Pledge.php
@@
-23,36
+23,22
@@
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+
*/
/**
/**
- *
File for the CiviCRM APIv3 Pledge functions
+ *
This api exposes CiviCRM Pledge.
*
* @package CiviCRM_APIv3
*
* @package CiviCRM_APIv3
- * @subpackage API_Pledge
- *
- * @copyright CiviCRM LLC (c) 2004-2014
- * @version $Id: Pledge.php
- *
- */
-
-/**
- * Include utility functions
*/
/**
*/
/**
- * Create
s or updates an Activity. See the example for usage
+ * Create
or updates an Pledge.
*
*
- * @param array $params
- * Associative array of property name/value.
- * pairs for the activity.
- * {@getfields pledge_create}
+ * @param $params
*
* @return array
* Array containing 'is_error' to denote success or failure and details of the created pledge
*
* @return array
* Array containing 'is_error' to denote success or failure and details of the created pledge
- *
- * @example PledgeCreate.php Standard create example
- *
+ * @throws \API_Exception
*/
function civicrm_api3_pledge_create($params) {
_civicrm_api3_pledge_format_params($params, TRUE);
*/
function civicrm_api3_pledge_create($params) {
_civicrm_api3_pledge_format_params($params, TRUE);
@@
-63,21
+49,18
@@
function civicrm_api3_pledge_create($params) {
}
/**
}
/**
- * Delete a pledge
+ * Delete a pledge
.
*
* @param array $params
* Array included 'pledge_id' of pledge to delete.
*
*
* @param array $params
* Array included 'pledge_id' of pledge to delete.
*
- * @return boolean
- * true if success, else false
- * {@getfields pledge_delete}
- * @example PledgeDelete.php
+ * @return array
*/
function civicrm_api3_pledge_delete($params) {
if (CRM_Pledge_BAO_Pledge::deletePledge($params['id'])) {
return civicrm_api3_create_success(array(
'id' => $params['id'],
*/
function civicrm_api3_pledge_delete($params) {
if (CRM_Pledge_BAO_Pledge::deletePledge($params['id'])) {
return civicrm_api3_create_success(array(
'id' => $params['id'],
- ), $params, '
p
ledge', 'delete');
+ ), $params, '
P
ledge', 'delete');
}
else {
return civicrm_api3_create_error('Could not delete pledge');
}
else {
return civicrm_api3_create_error('Could not delete pledge');
@@
-85,6
+68,8
@@
function civicrm_api3_pledge_delete($params) {
}
/**
}
/**
+ * Adjust metadata for pledge delete action.
+ *
* @param array $params
*/
function _civicrm_api3_pledge_delete_spec(&$params) {
* @param array $params
*/
function _civicrm_api3_pledge_delete_spec(&$params) {
@@
-93,7
+78,8
@@
function _civicrm_api3_pledge_delete_spec(&$params) {
}
/**
}
/**
- * return field specification specific to get requests
+ * Adjust field specification specific to get requests.
+ *
* @param array $params
*/
function _civicrm_api3_pledge_get_spec(&$params) {
* @param array $params
*/
function _civicrm_api3_pledge_get_spec(&$params) {
@@
-110,7
+96,8
@@
function _civicrm_api3_pledge_get_spec(&$params) {
}
/**
}
/**
- * return field specification specific to get requests
+ * Adjust field specification specific to get requests.
+ *
* @param array $params
*/
function _civicrm_api3_pledge_create_spec(&$params) {
* @param array $params
*/
function _civicrm_api3_pledge_create_spec(&$params) {
@@
-125,47
+112,44
@@
function _civicrm_api3_pledge_create_spec(&$params) {
}
/**
}
/**
- * Retrieve a set of pledges, given a set of input params
+ * Retrieve a set of pledges, given a set of input params
.
*
* @param array $params
* Input parameters. Use interrogate for possible fields.
*
* @return array
* array of pledges, if error an array with an error id and error message
*
* @param array $params
* Input parameters. Use interrogate for possible fields.
*
* @return array
* array of pledges, if error an array with an error id and error message
- * {@getfields pledge_get}
- * @example PledgeGet.php
*/
function civicrm_api3_pledge_get($params) {
$mode = CRM_Contact_BAO_Query::MODE_PLEDGE;
*/
function civicrm_api3_pledge_get($params) {
$mode = CRM_Contact_BAO_Query::MODE_PLEDGE;
- $entity = 'pledge';
- list($dao, $query) = _civicrm_api3_get_query_object($params, $mode,
$entity
);
+ list($dao, $query) = _civicrm_api3_get_query_object($params, $mode,
'Pledge'
);
$pledge = array();
while ($dao->fetch()) {
$pledge[$dao->pledge_id] = $query->store($dao);
}
$pledge = array();
while ($dao->fetch()) {
$pledge[$dao->pledge_id] = $query->store($dao);
}
- return civicrm_api3_create_success($pledge, $params, '
p
ledge', 'get', $dao);
+ return civicrm_api3_create_success($pledge, $params, '
P
ledge', 'get', $dao);
}
/**
}
/**
- * Set default to not return test params
+ * Set default to not return test params
.
*/
function _civicrm_api3_pledge_get_defaults() {
return array('pledge_test' => 0);
}
/**
*/
function _civicrm_api3_pledge_get_defaults() {
return array('pledge_test' => 0);
}
/**
- * Legacy function - I removed a bunch of stuff no longer required from here but it still needs
+ * Legacy function to format pledge parameters.
+ *
+ * I removed a bunch of stuff no longer required from here but it still needs
* more culling
* take the input parameter list as specified in the data model and
* convert it into the same format that we use in QF and BAO object
*
* @param array $values
* The reformatted properties that we can use internally.
* more culling
* take the input parameter list as specified in the data model and
* convert it into the same format that we use in QF and BAO object
*
* @param array $values
* The reformatted properties that we can use internally.
- *
- * @return array|CRM_Core_Error
*/
function _civicrm_api3_pledge_format_params(&$values) {
*/
function _civicrm_api3_pledge_format_params(&$values) {