(NFC) (dev/core#878) Simplify copyright header (api/*)
[civicrm-core.git] / api / v3 / Country.php
CommitLineData
ee93cc38 1<?php
ee93cc38
JJ
2/*
3 +--------------------------------------------------------------------+
a30c801b 4 | Copyright CiviCRM LLC. All rights reserved. |
ee93cc38 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 |
ee93cc38 9 +--------------------------------------------------------------------+
d25dd0ee 10 */
ee93cc38
JJ
11
12/**
c28e1768 13 * This api exposes CiviCRM country.
ee93cc38
JJ
14 *
15 * @package CiviCRM_APIv3
ee93cc38
JJ
16 */
17
ee93cc38 18/**
2e66abf8 19 * Add an Country for a contact.
ee93cc38 20 *
d0997921 21 * @param array $params
2e66abf8
EM
22 * Array per getfields metadata.
23 *
df76b023
EM
24 * @return array
25 * API result array
d0997921 26 * @throws \API_Exception
ee93cc38
JJ
27 */
28function civicrm_api3_country_create($params) {
1237d8d7 29 return _civicrm_api3_basic_create(_civicrm_api3_get_DAO(__FUNCTION__), $params, 'Country');
ee93cc38
JJ
30}
31
32/**
0aa0303c
EM
33 * Adjust Metadata for Create action.
34 *
35 * The metadata is used for setting defaults, documentation & validation.
ebf2b57b 36 *
cf470720 37 * @param array $params
b081365f 38 * Array of parameters determined by getfields.
ee93cc38
JJ
39 */
40function _civicrm_api3_country_create_spec(&$params) {
78abe068 41 $params['name']['api.required'] = 1;
ee93cc38
JJ
42}
43
44/**
2e66abf8 45 * Deletes an existing Country.
ee93cc38 46 *
cf470720 47 * @param array $params
ee93cc38 48 *
2e66abf8 49 * @return array
ee93cc38
JJ
50 */
51function civicrm_api3_country_delete($params) {
52 return _civicrm_api3_basic_delete(_civicrm_api3_get_DAO(__FUNCTION__), $params);
53}
54
55/**
2e66abf8 56 * Retrieve one or more countryies.
ee93cc38 57 *
cf470720 58 * @param array $params
2e66abf8 59 * Array per getfields metadata.
ee93cc38 60 *
a6c01b45 61 * @return array
72b3a70c 62 * api result array
ee93cc38
JJ
63 */
64function civicrm_api3_country_get($params) {
65
66 return _civicrm_api3_basic_get(_civicrm_api3_get_DAO(__FUNCTION__), $params);
67}