Merge pull request #17656 from civicrm/5.27
[civicrm-core.git] / api / v3 / SmsProvider.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
5 | |
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 |
9 +--------------------------------------------------------------------+
10 */
11
12 /**
13 * This api exposes CiviCRM sms_provider records.
14 *
15 * @package CiviCRM_APIv3
16 */
17
18 /**
19 * Save an sms_provider.
20 *
21 * @param array $params
22 *
23 * @return array
24 */
25 function civicrm_api3_sms_provider_create($params) {
26 return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'Provider');
27 }
28
29 /**
30 * Adjust Metadata for Create action.
31 *
32 * The metadata is used for setting defaults, documentation & validation.
33 *
34 * @param array $params
35 * Array of parameters determined by getfields.
36 */
37 function _civicrm_api3_sms_provider_create_spec(&$params) {
38 $params['domain_id']['api.default'] = CRM_Core_Config::domainID();
39 }
40
41 /**
42 * Get an sms_provider.
43 *
44 * @param array $params
45 *
46 * @return array
47 * Array of retrieved sms_provider property values.
48 */
49 function civicrm_api3_sms_provider_get($params) {
50 return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
51 }
52
53 /**
54 * Delete an sms_provider.
55 *
56 * @param array $params
57 *
58 * @return array
59 * Array of deleted values.
60 */
61 function civicrm_api3_sms_provider_delete($params) {
62 return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
63 }