3 * Test Generated example of using batch update API
6 function batch_update_example(){
8 'name' => 'New_Batch_04',
9 'title' => 'New Batch 04',
10 'description' => 'This is description for New Batch 04',
17 $result = civicrm_api3('batch', 'update', $params);
19 catch (CiviCRM_API3_Exception
$e) {
21 $errorMessage = $e->getMessage();
22 $errorCode = $e->getErrorCode();
23 $errorData = $e->getExtraParams();
24 return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
31 * Function returns array of result expected from previous function
33 function batch_update_expectedresult(){
35 $expectedResult = array(
43 'name' => 'New_Batch_04',
44 'title' => 'New Batch 04',
45 'description' => 'This is description for New Batch 04',
49 'modified_date' => '',
50 'saved_search_id' => '',
56 'payment_instrument_id' => '',
57 'exported_date' => '',
63 return $expectedResult;
68 * This example has been generated from the API test suite. The test that created it is called
70 * testUpdate and can be found in
71 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/BatchTest.php
73 * You can see the outcome of the API tests at
74 * http://tests.dev.civicrm.org/trunk/results-api_v3
76 * To Learn about the API read
77 * http://book.civicrm.org/developer/current/techniques/api/
79 * and review the wiki at
80 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
82 * Read more about testing here
83 * http://wiki.civicrm.org/confluence/display/CRM/Testing
85 * API Standards documentation:
86 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards