INFRA-132 - Docblock formatting fixes
[civicrm-core.git] / api / v3 / ParticipantStatusType.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.6 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2014 |
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
33 * @copyright CiviCRM LLC (c) 2004-2014
34 */
35
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 *
43 * @param array $params
44 * Associative array of property.
45 * name/value pairs to insert in new 'participant_status'
46 *
47 * @return array
48 * participant_status array
49 * {@getfields ParticipantStatusType_create}
50 * @example ParticipantStatusTypeCreate.php
51 * @access public
52 */
53 function civicrm_api3_participant_status_type_create($params) {
54 return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
55 }
56
57 /**
58 * Returns array of participant_statuses matching a set of one or more group properties
59 *
60 * @param array $params
61 * Array of one or more valid.
62 * property_name=>value pairs. If $params is set
63 * as null, all participant_statuses will be returned
64 *
65 * @return array
66 * Array of matching participant_statuses
67 * {@getfields ParticipantStatusType_get}
68 * @example ParticipantStatusTypeGet.php
69 * @access public
70 */
71 function civicrm_api3_participant_status_type_get($params) {
72 return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
73 }
74
75 /**
76 * delete an existing participant_status
77 *
78 * This method is used to delete any existing participant_status. id of the group
79 * to be deleted is required field in $params array
80 *
81 * @param array $params
82 * (reference) array containing id of the group.
83 * to be deleted
84 *
85 * @return array
86 * api result array
87 * {@getfields ParticipantStatusType_delete}
88 * @example ParticipantStatusTypeDelete.php
89 * @access public
90 */
91 function civicrm_api3_participant_status_type_delete($params) {
92 if (CRM_Event_BAO_ParticipantStatusType::deleteParticipantStatusType($params['id'])) {
93 return civicrm_api3_create_success(TRUE);
94 }
95
96 return civicrm_api3_create_error(TRUE);
97 }