Merge pull request #2480 from kurund/activity-optimization
[civicrm-core.git] / api / v3 / OptionGroup.php
1 <?php
2
3 function civicrm_api3_option_group_get($params) {
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 *
14 * @param array $params (reference) Associative array of property
15 * name/value pairs to insert in new 'survey'
16 *
17 * @return array survey array
18 *
19 * @access public
20 */
21 function civicrm_api3_option_group_create($params) {
22 return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
23 }
24
25 /**
26 * Adjust Metadata for Create action
27 *
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 }
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 }