3 * Test Generated example of using loc_block createEntities API
4 * Create entities and location block in 1 api call *
6 function loc_block_createentities_example(){
9 'location_type_id' => 1,
10 'email' => 'test2@loc.block',
13 'location_type_id' => 1,
14 'phone' => '987654321',
17 'location_type_id' => 1,
18 'phone' => '456-7890',
21 'location_type_id' => 1,
22 'street_address' => '987654321',
27 $result = civicrm_api3('loc_block', 'createEntities', $params);
29 catch (CiviCRM_API3_Exception
$e) {
31 $errorMessage = $e->getMessage();
32 $errorCode = $e->getErrorCode();
33 $errorData = $e->getExtraParams();
34 return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
41 * Function returns array of result expected from previous function
43 function loc_block_createentities_expectedresult(){
45 $expectedResult = array(
54 'location_type_id' => '1',
57 'street_address' => '987654321',
58 'manual_geo_code' => 0,
63 'location_type_id' => '1',
64 'email' => 'test2@loc.block',
71 'signature_text' => '',
72 'signature_html' => '',
77 'location_type_id' => '1',
80 'mobile_provider_id' => '',
81 'phone' => '987654321',
83 'phone_numeric' => '',
84 'phone_type_id' => '',
89 'location_type_id' => '1',
92 'mobile_provider_id' => '',
93 'phone' => '456-7890',
95 'phone_numeric' => '',
96 'phone_type_id' => '',
103 'address_2_id' => '',
111 return $expectedResult;
116 * This example has been generated from the API test suite. The test that created it is called
118 * testCreateLocBlockEntities and can be found in
119 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/LocBlockTest.php
121 * You can see the outcome of the API tests at
122 * https://test.civicrm.org/job/CiviCRM-master-git/
124 * To Learn about the API read
125 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
127 * Browse the api on your own site with the api explorer
128 * http://MYSITE.ORG/path/to/civicrm/api/explorer
130 * Read more about testing here
131 * http://wiki.civicrm.org/confluence/display/CRM/Testing
133 * API Standards documentation:
134 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards