3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
13 * This api exposes CiviCRM participant status options.
15 * @package CiviCRM_APIv3
19 * Create/update participant_status.
21 * This API is used to create new participant_status or update any of the existing
22 * In case of updating existing participant_status, id of that particular participant_status must
23 * be in $params array.
25 * @param array $params
26 * name/value pairs to insert in new 'participant_status'
29 * participant_status array
31 function civicrm_api3_participant_status_type_create($params) {
32 return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__
), $params, 'ParticipantStatusType');
36 * Returns array of participant_statuses matching a set of one or more group properties.
38 * @param array $params
39 * Array of properties. If empty, all records will be returned.
42 * Array of matching participant_statuses
44 function civicrm_api3_participant_status_type_get($params) {
45 return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__
), $params);
49 * Delete an existing participant_status.
51 * This method is used to delete any existing participant_status given its id.
53 * @param array $params
55 * @return array api result array
56 * @throws API_Exception
58 function civicrm_api3_participant_status_type_delete($params) {
59 if (CRM_Event_BAO_ParticipantStatusType
::deleteParticipantStatusType($params['id'])) {
60 return civicrm_api3_create_success(TRUE);
63 throw new API_Exception('Could not delete participant status type id ' . $params['id']);