Merge pull request #4863 from totten/master-phpcbf4
[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
TO
22 *
23 * @return array survey array
24 *
25 * @access public
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/**
6a488035 32 * Adjust Metadata for Create action
1c88e578 33 *
6a488035 34 * The metadata is used for setting defaults, documentation & validation
cf470720
TO
35 * @param array $params
36 * Array or parameters determined by getfields.
6a488035
TO
37 */
38function _civicrm_api3_option_group_create_spec(&$params) {
39 $params['name']['api.unique'] = 1;
40}
4033343a 41
42/**
43 * delete an existing Option Group
44 *
45 * This method is used to delete any existing Option Group. id of the group
46 * to be deleted is required field in $params array
47 *
cf470720
TO
48 * @param array $params
49 * Array containing id of the group.
4033343a 50 * to be deleted
51 *
c206647d 52 * @return array API Result Array
4033343a 53 * message otherwise
54 * {@getfields OptionGroup_delete}
55 * @access public
56 */
57function civicrm_api3_option_group_delete($params) {
58 return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
59}