Merge pull request #22966 from eileenmcnaughton/retrieve
[civicrm-core.git] / api / v3 / MappingField.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 MappingField records.
15 *
16 * @package CiviCRM_APIv3
17 */
18
19/**
20 * Add a Mapping Field.
21 *
22 * @param array $params
23 *
24 * @return array
25 */
26function civicrm_api3_mapping_field_create($params) {
a25b46e9 27 return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'MappingField');
927f93e2
TM
28}
29
30/**
31 * Adjust Metadata for Create action.
32 *
33 * The metadata is used for setting defaults, documentation & validation.
34 *
35 * @param array $params
36 * Array of parameters determined by getfields.
37 */
38function _civicrm_api3_mapping_field_create_spec(&$params) {
39 $params['mapping_id']['api.required'] = 1;
40}
41
42/**
43 * Deletes an existing Mapping Field.
44 *
45 * @param array $params
46 *
47 * @return array
48 * API result Array
49 */
50function civicrm_api3_mapping_field_delete($params) {
51 return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
52}
53
54/**
55 * Retrieve one or more Mapping Fields.
56 *
57 * @param array $params
58 * An associative array of name/value pairs.
59 *
60 * @return array
61 * details of found Mapping Fields
62 */
63function civicrm_api3_mapping_field_get($params) {
64 return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
65}