Merge pull request #15390 from kewljuice/patch-4
[civicrm-core.git] / api / v3 / EntityBatch.php
CommitLineData
a646bdd2
SB
1<?php
2/*
a30c801b
TO
3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
a646bdd2 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 |
9 +--------------------------------------------------------------------+ */
a646bdd2
SB
10
11/**
12 * This api exposes CiviCRM EntityBatch records.
13 *
14 * Use this api to add/remove entities from a batch.
15 * To create/update/delete the batches themselves, use the Batch api.
16 *
17 * @package CiviCRM_APIv3
18 */
19
20/**
21 * Get entity batches.
22 *
23 * @param array $params
24 *
25 * @return array
26 */
27function civicrm_api3_entity_batch_get($params) {
28 return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
29}
30
31/**
32 * Adjust Metadata for Create action.
33 *
34 * The metadata is used for setting defaults, documentation & validation.
35 *
36 * @param array $params
37 * Array of parameters determined by getfields.
38 */
39function _civicrm_api3_entity_batch_create_spec(&$params) {
40 $params['entity_id']['api.required'] = 1;
41 $params['batch_id']['api.required'] = 1;
42}
43
44/**
45 * Create an entity batch.
46 *
47 * @param array $params
48 *
49 * @return array
50 */
51function civicrm_api3_entity_batch_create($params) {
a25b46e9 52 return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'EntityBatch');
a646bdd2
SB
53}
54
55/**
56 * Mark entity batch as removed.
57 *
58 * @param array $params
59 *
60 * @return array
61 */
62function civicrm_api3_entity_batch_delete($params) {
63 return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
64}