3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
13 * This api exposes CiviCRM LocationType records.
15 * @package CiviCRM_APIv3
21 * @param array $params
26 function civicrm_api3_location_type_create($params) {
27 //set display_name equal to name if it's not defined
28 if (!array_key_exists('display_name', $params) && array_key_exists('name', $params)) {
29 $params['display_name'] = $params['name'];
32 return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__
), $params, 'LocationType');
36 * Adjust Metadata for Create action.
38 * The metadata is used for setting defaults, documentation & validation.
40 * @param array $params
41 * Array of parameters determined by getfields.
43 function _civicrm_api3_location_type_create_spec(&$params) {
44 $params['is_active']['api.default'] = 1;
45 $params['name']['api.required'] = 1;
49 * Deletes an existing LocationType.
51 * @param array $params
56 function civicrm_api3_location_type_delete($params) {
57 return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__
), $params);
61 * Retrieve one or more LocationTypes.
63 * @param array $params
64 * An associative array of name/value pairs.
69 function civicrm_api3_location_type_get($params) {
70 return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__
), $params);