| 1 | <?php |
| 2 | |
| 3 | /* |
| 4 | +--------------------------------------------------------------------+ |
| 5 | | Copyright CiviCRM LLC. All rights reserved. | |
| 6 | | | |
| 7 | | This work is published under the GNU AGPLv3 license with some | |
| 8 | | permitted exceptions and without any warranty. For full license | |
| 9 | | and copyright information, see https://civicrm.org/licensing | |
| 10 | +--------------------------------------------------------------------+ |
| 11 | */ |
| 12 | |
| 13 | /** |
| 14 | * This api exposes CiviCRM Mapping records. |
| 15 | * |
| 16 | * @package CiviCRM_APIv3 |
| 17 | */ |
| 18 | |
| 19 | /** |
| 20 | * Add a Mapping. |
| 21 | * |
| 22 | * @param array $params |
| 23 | * |
| 24 | * @return array |
| 25 | */ |
| 26 | function civicrm_api3_mapping_create($params) { |
| 27 | return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'Mapping'); |
| 28 | } |
| 29 | |
| 30 | /** |
| 31 | * Adjust Metadata for Create action. |
| 32 | * |
| 33 | * The metadata is used for setting defaults, documentation & validation. |
| 34 | * |
| 35 | * @param array $spec |
| 36 | * Array of parameters determined by getfields. |
| 37 | */ |
| 38 | function _civicrm_api3_mapping_create_spec(&$spec) { |
| 39 | $spec['name']['api.required'] = 1; |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * Deletes an existing Mapping. |
| 44 | * |
| 45 | * @param array $params |
| 46 | * |
| 47 | * @return array |
| 48 | * API result Array |
| 49 | */ |
| 50 | function civicrm_api3_mapping_delete($params) { |
| 51 | return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params); |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * Retrieve one or more Mappings. |
| 56 | * |
| 57 | * @param array $params |
| 58 | * An associative array of name/value pairs. |
| 59 | * |
| 60 | * @return array |
| 61 | * details of found Mappings |
| 62 | */ |
| 63 | function civicrm_api3_mapping_get($params) { |
| 64 | return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params); |
| 65 | } |