Merge remote-tracking branch 'upstream/4.5' into 4.5-master-2015-02-02-18-36-16
[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 *
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 * {@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 }