Merge pull request #12747 from mattwire/tabheader_extract_and_events
[civicrm-core.git] / api / v3 / Website.php
CommitLineData
6a488035 1<?php
6a488035
TO
2/*
3 +--------------------------------------------------------------------+
fee14197 4 | CiviCRM version 5 |
6a488035 5 +--------------------------------------------------------------------+
1f4ea726 6 | Copyright CiviCRM LLC (c) 2004-2017 |
6a488035
TO
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13 | |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
18 | |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
d25dd0ee 26 */
6a488035
TO
27
28/**
b081365f 29 * This api exposes CiviCRM website records.
6a488035
TO
30 *
31 * @package CiviCRM_APIv3
6a488035
TO
32 */
33
6a488035 34/**
1747ab99 35 * Add an Website for a contact.
6a488035 36 *
c490a46a 37 * @param array $params
77b97be7 38 *
a6c01b45 39 * @return array
00f8641b 40 * API result array
6a488035
TO
41 */
42function civicrm_api3_website_create($params) {
ebdf0a2c 43 return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'Website');
11e09c59 44}
6a488035 45
11e09c59 46/**
0aa0303c
EM
47 * Adjust Metadata for Create action.
48 *
49 * The metadata is used for setting defaults, documentation & validation.
6a488035 50 *
cf470720 51 * @param array $params
b081365f 52 * Array of parameters determined by getfields.
6a488035
TO
53 */
54function _civicrm_api3_website_create_spec(&$params) {
55 $params['contact_id']['api.required'] = 1;
56}
57
58/**
9d32e6f7
EM
59 * Deletes an existing Website.
60 *
cf470720 61 * @param array $params
9d32e6f7 62 *
1bc8dc45 63 * @return array
00f8641b 64 * API result array
1bc8dc45 65 * @throws \API_Exception
6a488035
TO
66 */
67function civicrm_api3_website_delete($params) {
deeb0e2b 68 return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
6a488035
TO
69}
70
71/**
9d32e6f7 72 * Retrieve one or more websites.
6a488035 73 *
317fceb4 74 * @param array $params
6a488035 75 *
a6c01b45 76 * @return array
00f8641b 77 * API result array
6a488035
TO
78 */
79function civicrm_api3_website_get($params) {
244bbdd8 80 return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params, TRUE, 'Website');
6a488035 81}