Commit | Line | Data |
---|---|---|
6a488035 | 1 | <?php |
6a488035 TO |
2 | /* |
3 | +--------------------------------------------------------------------+ | |
39de6fd5 | 4 | | CiviCRM version 4.6 | |
6a488035 | 5 | +--------------------------------------------------------------------+ |
731a0992 | 6 | | Copyright CiviCRM LLC (c) 2004-2014 | |
6a488035 TO |
7 | +--------------------------------------------------------------------+ |
8 | | This file is a part of CiviCRM. | | |
9 | | | | |
10 | | CiviCRM is free software; you can copy, modify, and distribute it | | |
11 | | under the terms of the GNU Affero General Public License | | |
12 | | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | | |
13 | | | | |
14 | | CiviCRM is distributed in the hope that it will be useful, but | | |
15 | | WITHOUT ANY WARRANTY; without even the implied warranty of | | |
16 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | | |
17 | | See the GNU Affero General Public License for more details. | | |
18 | | | | |
19 | | You should have received a copy of the GNU Affero General Public | | |
20 | | License and the CiviCRM Licensing Exception along | | |
21 | | with this program; if not, contact CiviCRM LLC | | |
22 | | at info[AT]civicrm[DOT]org. If you have questions about the | | |
23 | | GNU Affero General Public License or the licensing of CiviCRM, | | |
24 | | see the CiviCRM license FAQ at http://civicrm.org/licensing | | |
25 | +--------------------------------------------------------------------+ | |
26 | */ | |
27 | ||
28 | /** | |
29 | * File for the CiviCRM APIv3 group functions | |
30 | * | |
31 | * @package CiviCRM_APIv3 | |
32 | * @subpackage API_Event | |
731a0992 | 33 | * @copyright CiviCRM LLC (c) 2004-2014 |
6a488035 TO |
34 | */ |
35 | ||
6a488035 TO |
36 | /** |
37 | * create/update participant_status | |
38 | * | |
39 | * This API is used to create new participant_status or update any of the existing | |
40 | * In case of updating existing participant_status, id of that particular participant_status must | |
41 | * be in $params array. | |
42 | * | |
cf470720 TO |
43 | * @param array $params |
44 | * Associative array of property. | |
6a488035 TO |
45 | * name/value pairs to insert in new 'participant_status' |
46 | * | |
a6c01b45 | 47 | * @return array |
72b3a70c | 48 | * participant_status array |
317fceb4 | 49 | * {@getfields ParticipantStatusType_create} |
6a488035 | 50 | * @example ParticipantStatusTypeCreate.php |
6a488035 TO |
51 | */ |
52 | function civicrm_api3_participant_status_type_create($params) { | |
53 | return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params); | |
54 | } | |
55 | ||
56 | /** | |
c206647d | 57 | * Returns array of participant_statuses matching a set of one or more group properties |
6a488035 | 58 | * |
cf470720 TO |
59 | * @param array $params |
60 | * Array of one or more valid. | |
6a488035 | 61 | * property_name=>value pairs. If $params is set |
c206647d | 62 | * as null, all participant_statuses will be returned |
6a488035 | 63 | * |
a6c01b45 | 64 | * @return array |
72b3a70c | 65 | * Array of matching participant_statuses |
317fceb4 | 66 | * {@getfields ParticipantStatusType_get} |
6a488035 | 67 | * @example ParticipantStatusTypeGet.php |
6a488035 TO |
68 | */ |
69 | function civicrm_api3_participant_status_type_get($params) { | |
70 | return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params); | |
71 | } | |
72 | ||
73 | /** | |
74 | * delete an existing participant_status | |
75 | * | |
76 | * This method is used to delete any existing participant_status. id of the group | |
77 | * to be deleted is required field in $params array | |
78 | * | |
cf470720 TO |
79 | * @param array $params |
80 | * (reference) array containing id of the group. | |
6a488035 TO |
81 | * to be deleted |
82 | * | |
a6c01b45 | 83 | * @return array |
72b3a70c | 84 | * api result array |
317fceb4 | 85 | * {@getfields ParticipantStatusType_delete} |
6a488035 | 86 | * @example ParticipantStatusTypeDelete.php |
6a488035 TO |
87 | */ |
88 | function civicrm_api3_participant_status_type_delete($params) { | |
89 | if (CRM_Event_BAO_ParticipantStatusType::deleteParticipantStatusType($params['id'])) { | |
90 | return civicrm_api3_create_success(TRUE); | |
91 | } | |
92 | ||
93 | return civicrm_api3_create_error(TRUE); | |
94 | } |