fbd1c79ad52976efc69eb3422efb9ed313699265
[civicrm-core.git] / api / v3 / OptionGroup.php
1 <?php
2
3 /**
4 * @param array $params
5 *
6 * @return array
7 */
8 function civicrm_api3_option_group_get($params) {
9 return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
10 }
11
12 /**
13 * create/update survey
14 *
15 * This API is used to create new survey or update any of the existing
16 * In case of updating existing survey, id of that particular survey must
17 * be in $params array.
18 *
19 * @param array $params
20 * (reference) Associative array of property.
21 * name/value pairs to insert in new 'survey'
22 *
23 * @return array
24 * survey array
25 *
26 * @access public
27 */
28 function civicrm_api3_option_group_create($params) {
29 return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
30 }
31
32 /**
33 * Adjust Metadata for Create action
34 *
35 * The metadata is used for setting defaults, documentation & validation
36 * @param array $params
37 * Array or parameters determined by getfields.
38 */
39 function _civicrm_api3_option_group_create_spec(&$params) {
40 $params['name']['api.unique'] = 1;
41 }
42
43 /**
44 * delete an existing Option Group
45 *
46 * This method is used to delete any existing Option Group. id of the group
47 * to be deleted is required field in $params array
48 *
49 * @param array $params
50 * Array containing id of the group.
51 * to be deleted
52 *
53 * @return array
54 * API Result Array
55 * message otherwise
56 * {@getfields OptionGroup_delete}
57 * @access public
58 */
59 function civicrm_api3_option_group_delete($params) {
60 return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
61 }