3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
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 +--------------------------------------------------------------------+
13 * This api exposes CiviCRM Batch records.
15 * @package CiviCRM_APIv3
21 * @param array $params
24 * @throws \API_Exception
25 * @throws \Civi\API\Exception\UnauthorizedException
27 function civicrm_api3_batch_create($params) {
28 return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__
), $params, 'Batch');
32 * Adjust Metadata for Create action.
34 * The metadata is used for setting defaults, documentation & validation.
36 * @param array $params
37 * Array of parameters determined by getfields.
39 function _civicrm_api3_batch_create_spec(&$params) {
40 //@todo - the entity table field looks like it is not actually required & should probably be removed (or a description added if
41 // it is actually required)
42 $params['entity_table']['api.default'] = "civicrm_batch";
43 $params['entity_table']['type'] = CRM_Utils_Type
::T_STRING
;
44 $params['entity_table']['title'] = 'Batch Entity Table - remove?';
45 $params['created_id']['api.default'] = 'user_contact_id';
46 $params['created_date']['api.default'] = 'now';
47 $params['modified_id']['api.default'] = 'user_contact_id';
48 $params['modified_date']['api.default'] = 'now';
49 $params['status_id']['api.required'] = 1;
50 $params['title']['api.required'] = 1;
51 $params['status_id']['api.required'] = 1;
57 * @param array $params
60 * Array of retrieved batch property values.
62 function civicrm_api3_batch_get($params) {
63 return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__
), $params);
69 * @param array $params
72 * Array of deleted values.
73 * @throws \API_Exception
74 * @throws \Civi\API\Exception\UnauthorizedException
76 function civicrm_api3_batch_delete($params) {
77 return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__
), $params);