af057792cd619dfb7a7b3cb73227463c3cd1242c
[civicrm-core.git] / api / v3 / examples / BatchUpdate.php
1 <?php
2
3 /*
4
5 */
6 function batch_update_example(){
7 $params = array(
8 'name' => 'New_Batch_04',
9 'title' => 'New Batch 04',
10 'description' => 'This is description for New Batch 04',
11 'total' => '400.44',
12 'item_count' => 4,
13 'version' => 3,
14 'id' => 3,
15 );
16
17 $result = civicrm_api( 'batch','update',$params );
18
19 return $result;
20 }
21
22 /*
23 * Function returns array of result expected from previous function
24 */
25 function batch_update_expectedresult(){
26
27 $expectedResult = array(
28 'is_error' => 0,
29 'version' => 3,
30 'count' => 1,
31 'id' => 3,
32 'values' => array(
33 '3' => array(
34 'id' => '3',
35 'name' => 'New_Batch_04',
36 'title' => 'New Batch 04',
37 'description' => 'This is description for New Batch 04',
38 'created_id' => '',
39 'created_date' => '',
40 'modified_id' => '',
41 'modified_date' => '2012-11-14 16:02:35',
42 'saved_search_id' => '',
43 'status_id' => '',
44 'type_id' => '',
45 'mode_id' => '',
46 'total' => '400.44',
47 'item_count' => '4',
48 'payment_instrument_id' => '',
49 'exported_date' => '',
50 ),
51 ),
52 );
53
54 return $expectedResult ;
55 }
56
57
58 /*
59 * This example has been generated from the API test suite. The test that created it is called
60 *
61 * testUpdate and can be found in
62 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/BatchTest.php
63 *
64 * You can see the outcome of the API tests at
65 * http://tests.dev.civicrm.org/trunk/results-api_v3
66 *
67 * To Learn about the API read
68 * http://book.civicrm.org/developer/current/techniques/api/
69 *
70 * and review the wiki at
71 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
72 *
73 * Read more about testing here
74 * http://wiki.civicrm.org/confluence/display/CRM/Testing
75 *
76 * API Standards documentation:
77 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
78 */