4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC. All rights reserved. |
7 | This work is published under the GNU AGPLv3 license with some |
8 | permitted exceptions and without any warranty. For full license |
9 | and copyright information, see https://civicrm.org/licensing |
10 +--------------------------------------------------------------------+
14 * This api exposes CiviCRM PCP records.
17 * @package CiviCRM_APIv3
21 * Create or update a survey.
23 * @param array $params
24 * Array per getfields metadata.
26 * @return array api result array
28 function civicrm_api3_pcp_create($params) {
29 return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__
), $params, 'Pcp');
33 * Adjust Metadata for Create action.
35 * The metadata is used for setting defaults, documentation & validation.
37 * @param array $params
38 * Array of parameters determined by getfields.
40 function _civicrm_api3_pcp_create_spec(&$params) {
41 $params['title']['api.required'] = 1;
42 $params['contact_id']['api.required'] = 1;
43 $params['page_id']['api.required'] = 1;
44 $params['pcp_block_id']['api.required'] = 1;
48 * Returns array of pcps matching a set of one or more properties.
50 * @param array $params
53 * @return array Array of matching pcps
55 function civicrm_api3_pcp_get($params) {
56 return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__
), $params, TRUE, 'Pcp');
60 * Delete an existing PCP.
62 * This method is used to delete any existing PCP given its id.
64 * @param array $params
67 * @return array api result array
69 function civicrm_api3_pcp_delete($params) {
70 return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__
), $params);