Merge pull request #19375 from civicrm/5.34
[civicrm-core.git] / api / v3 / Mapping.php
CommitLineData
927f93e2
TM
1<?php
2
3/*
a30c801b
TO
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC. All rights reserved. |
6 | |
7 | This work is published under the GNU AGPLv3 license with some |
8 | permitted exceptions and without any warranty. For full license |
9 | and copyright information, see https://civicrm.org/licensing |
10 +--------------------------------------------------------------------+
927f93e2
TM
11 */
12
13/**
14 * This api exposes CiviCRM Mapping records.
15 *
16 * @package CiviCRM_APIv3
17 */
18
19/**
20 * Add a Mapping.
21 *
22 * @param array $params
23 *
24 * @return array
25 */
26function civicrm_api3_mapping_create($params) {
ddaf2161 27 return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'Mapping');
927f93e2
TM
28}
29
df197a56 30/**
31 * Adjust Metadata for Create action.
32 *
33 * The metadata is used for setting defaults, documentation & validation.
34 *
35 * @param array $spec
36 * Array of parameters determined by getfields.
37 */
38function _civicrm_api3_mapping_create_spec(&$spec) {
39 $spec['name']['api.required'] = 1;
40}
41
927f93e2
TM
42/**
43 * Deletes an existing Mapping.
44 *
45 * @param array $params
46 *
47 * @return array
48 * API result Array
49 */
50function civicrm_api3_mapping_delete($params) {
51 return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
52}
53
54/**
55 * Retrieve one or more Mappings.
56 *
57 * @param array $params
58 * An associative array of name/value pairs.
59 *
60 * @return array
61 * details of found Mappings
62 */
63function civicrm_api3_mapping_get($params) {
64 return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
65}