3 * Test Generated example of using loc_block get API
4 * Get entities and location block in 1 api call *
6 function loc_block_get_example(){
13 $result = civicrm_api3('loc_block', 'get', $params);
15 catch (CiviCRM_API3_Exception
$e) {
17 $errorMessage = $e->getMessage();
18 $errorCode = $e->getErrorCode();
19 $errorData = $e->getExtraParams();
20 return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
27 * Function returns array of result expected from previous function
29 function loc_block_get_expectedresult(){
31 $expectedResult = array(
39 'location_type_id' => '1',
42 'street_address' => '987654321',
43 'manual_geo_code' => 0,
47 'location_type_id' => '1',
48 'email' => 'test2@loc.block',
56 'location_type_id' => '1',
59 'phone' => '987654321',
60 'phone_numeric' => '987654321',
64 'location_type_id' => '1',
67 'phone' => '456-7890',
68 'phone_numeric' => '4567890',
72 return $expectedResult;
77 * This example has been generated from the API test suite. The test that created it is called
79 * testCreateLocBlockEntities and can be found in
80 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/LocBlockTest.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/explorer
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