3 * Test Generated example demonstrating the Batch.create API.
8 function batch_create_example() {
10 'name' => 'New_Batch_04',
11 'title' => 'New Batch 04',
12 'description' => 'This is description for New Batch 04',
19 $result = civicrm_api3('Batch', 'create', $params);
21 catch (CiviCRM_API3_Exception
$e) {
23 $errorMessage = $e->getMessage();
24 $errorCode = $e->getErrorCode();
25 $errorData = $e->getExtraParams();
28 'error_message' => $errorMessage,
29 'error_code' => $errorCode,
30 'error_data' => $errorData,
38 * Function returns array of result expected from previous function.
43 function batch_create_expectedresult() {
45 $expectedResult = array(
53 'name' => 'New_Batch_04',
54 'title' => 'New Batch 04',
55 'description' => 'This is description for New Batch 04',
59 'modified_date' => '',
60 'saved_search_id' => '',
66 'payment_instrument_id' => '',
67 'exported_date' => '',
73 return $expectedResult;
77 * This example has been generated from the API test suite.
78 * The test that created it is called "testUpdate"
79 * and can be found at:
80 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/BatchTest.php
82 * You can see the outcome of the API tests at
83 * https://test.civicrm.org/job/CiviCRM-master-git/
85 * To Learn about the API read
86 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
88 * Browse the api on your own site with the api explorer
89 * http://MYSITE.ORG/path/to/civicrm/api
91 * Read more about testing here
92 * http://wiki.civicrm.org/confluence/display/CRM/Testing
94 * API Standards documentation:
95 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards