Merge pull request #15842 from totten/master-config-backend
[civicrm-core.git] / api / v3 / ActivityContact.php
CommitLineData
3ed73cde 1<?php
3ed73cde 2/*
3 +--------------------------------------------------------------------+
a30c801b 4 | Copyright CiviCRM LLC. All rights reserved. |
3ed73cde 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 |
3ed73cde 9 +--------------------------------------------------------------------+
d25dd0ee 10 */
3ed73cde 11
12/**
244bbdd8 13 * This api exposes the CiviCRM ActivityContact join table.
3ed73cde 14 *
15 * @package CiviCRM_APIv3
3ed73cde 16 */
17
18/**
dc64d047 19 * Add a record relating a contact with an activity.
3ed73cde 20 *
c490a46a 21 * @param array $params
77b97be7 22 *
a6c01b45 23 * @return array
1747ab99 24 * API result array.
3ed73cde 25 */
26function civicrm_api3_activity_contact_create($params) {
98fd592b 27 return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'ActivityContact');
3ed73cde 28}
29
30/**
0aa0303c
EM
31 * Adjust Metadata for Create action.
32 *
33 * The metadata is used for setting defaults, documentation & validation.
3ed73cde 34 *
cf470720 35 * @param array $params
b081365f 36 * Array of parameters determined by getfields.
3ed73cde 37 */
38function _civicrm_api3_activity_contact_create_spec(&$params) {
39 $params['contact_id']['api.required'] = 1;
40 $params['activity_id']['api.required'] = 1;
41}
42
43/**
dc64d047 44 * Delete an existing ActivityContact record.
3ed73cde 45 *
cf470720 46 * @param array $params
3ed73cde 47 *
a6c01b45 48 * @return array
00f8641b 49 * API result array
3ed73cde 50 */
51function civicrm_api3_activity_contact_delete($params) {
52 return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
53}
54
55/**
56 * Get a ActivityContact.
57 *
cf470720
TO
58 * @param array $params
59 * An associative array of name/value pairs.
3ed73cde 60 *
a6c01b45 61 * @return array
00f8641b 62 * API result array
3ed73cde 63 */
64function civicrm_api3_activity_contact_get($params) {
65 return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
66}