Merge pull request #4918 from colemanw/INFRA-132
[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 */
27 function civicrm_api3_option_group_create($params) {
28 return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
29 }
30
31 /**
32 * Adjust Metadata for Create action
33 *
34 * The metadata is used for setting defaults, documentation & validation
35 * @param array $params
36 * Array or parameters determined by getfields.
37 */
38 function _civicrm_api3_option_group_create_spec(&$params) {
39 $params['name']['api.unique'] = 1;
40 }
41
42 /**
43 * delete an existing Option Group
44 *
45 * This method is used to delete any existing Option Group. id of the group
46 * to be deleted is required field in $params array
47 *
48 * @param array $params
49 * Array containing id of the group.
50 * to be deleted
51 *
52 * @return array
53 * API Result Array
54 * message otherwise
55 * {@getfields OptionGroup_delete}
56 */
57 function civicrm_api3_option_group_delete($params) {
58 return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
59 }