Merge pull request #17376 from artfulrobot/artfulrobot-public-status-messages
[civicrm-core.git] / api / v3 / UFMatch.php
CommitLineData
6a488035 1<?php
6a488035
TO
2/*
3 +--------------------------------------------------------------------+
a30c801b 4 | Copyright CiviCRM LLC. All rights reserved. |
6a488035 5 | |
a30c801b
TO
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 |
6a488035
TO
9 +--------------------------------------------------------------------+
10 */
11
12/**
c28e1768 13 * This api exposes CiviCRM user framework match.
6a488035
TO
14 *
15 * @package CiviCRM_APIv3
6a488035
TO
16 */
17
18/**
9d32e6f7 19 * Get the contact_id given a uf_id or vice versa.
6a488035
TO
20 *
21 * @param array $params
22 *
a6c01b45 23 * @return array
6a488035
TO
24 */
25function civicrm_api3_uf_match_get($params) {
26 return _civicrm_api3_basic_get('CRM_Core_BAO_UFMatch', $params);
27}
28
29/**
9d32e6f7 30 * Create or update a UF Match record.
6a488035 31 *
cf470720 32 * @param array $params
9d32e6f7 33 * Array per getfields metadata.
6a488035 34 *
a6c01b45 35 * @return array
9d32e6f7 36 * Api result array
6a488035
TO
37 */
38function civicrm_api3_uf_match_create($params) {
98fd592b 39 return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'UFMatch');
6a488035 40}
11e09c59
TO
41
42/**
0aa0303c
EM
43 * Adjust Metadata for Create action.
44 *
45 * The metadata is used for setting defaults, documentation & validation.
11e09c59 46 *
cf470720 47 * @param array $params
b081365f 48 * Array of parameters determined by getfields.
11e09c59 49 */
6a488035
TO
50function _civicrm_api3_uf_match_create_spec(&$params) {
51 $params['contact_id']['api.required'] = 1;
52 $params['uf_id']['api.required'] = 1;
53 $params['uf_name']['api.required'] = 1;
6a488035
TO
54}
55
56/**
9d32e6f7 57 * Delete a UF Match record.
6a488035 58 *
cf470720 59 * @param array $params
6a488035 60 *
a6c01b45 61 * @return array
9d32e6f7 62 * Api result array.
6a488035
TO
63 */
64function civicrm_api3_uf_match_delete($params) {
65 return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
66}