Merge remote-tracking branch 'rajgo94/mailingui-new' into master-abtest
[civicrm-core.git] / api / v3 / OptionGroup.php
1 <?php
2
3 /**
4 * @param $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 (reference) Associative array of property
20 * name/value pairs to insert in new 'survey'
21 *
22 * @return array survey array
23 *
24 * @access public
25 */
26 function civicrm_api3_option_group_create($params) {
27 return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
28 }
29
30 /**
31 * Adjust Metadata for Create action
32 *
33 * The metadata is used for setting defaults, documentation & validation
34 * @param array $params array or parameters determined by getfields
35 */
36 function _civicrm_api3_option_group_create_spec(&$params) {
37 $params['name']['api.unique'] = 1;
38 }
39
40 /**
41 * delete an existing Option Group
42 *
43 * This method is used to delete any existing Option Group. id of the group
44 * to be deleted is required field in $params array
45 *
46 * @param array $params array containing id of the group
47 * to be deleted
48 *
49 * @return array API Result Array
50 * message otherwise
51 * {@getfields OptionGroup_delete}
52 * @access public
53 */
54 function civicrm_api3_option_group_delete($params) {
55 return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
56 }