Merge pull request #5059 from totten/master-validation
[civicrm-core.git] / api / v3 / OptionGroup.php
CommitLineData
6a488035 1<?php
6a488035 2
aa1b1481 3/**
c490a46a 4 * @param array $params
aa1b1481
EM
5 *
6 * @return array
7 */
6a488035 8function civicrm_api3_option_group_get($params) {
6a488035
TO
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 *
cf470720
TO
19 * @param array $params
20 * (reference) Associative array of property.
4033343a 21 * name/value pairs to insert in new 'survey'
6a488035 22 *
a6c01b45 23 * @return array
72b3a70c 24 * survey array
6a488035 25 *
6a488035
TO
26 */
27function civicrm_api3_option_group_create($params) {
4033343a 28 return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
6a488035
TO
29}
30
11e09c59 31/**
211e2fca
EM
32 * Adjust Metadata for Create action.
33 *
34 * The metadata is used for setting defaults, documentation & validation.
1c88e578 35 *
cf470720
TO
36 * @param array $params
37 * Array or parameters determined by getfields.
6a488035
TO
38 */
39function _civicrm_api3_option_group_create_spec(&$params) {
40 $params['name']['api.unique'] = 1;
41}
4033343a 42
43/**
211e2fca 44 * Delete an existing Option Group.
4033343a 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 *
cf470720
TO
49 * @param array $params
50 * Array containing id of the group.
4033343a 51 * to be deleted
52 *
a6c01b45 53 * @return array
72b3a70c 54 * API Result Array
59f4c9ee 55 * {@getfields OptionGroup_delete}
4033343a 56 */
57function civicrm_api3_option_group_delete($params) {
58 return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
59}