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