3 * Test Generated example demonstrating the LocBlock.get API.
5 * Get entities and location block in 1 api call
10 function loc_block_get_example() {
17 $result = civicrm_api3('LocBlock', 'get', $params);
19 catch (CiviCRM_API3_Exception
$e) {
21 $errorMessage = $e->getMessage();
22 $errorCode = $e->getErrorCode();
23 $errorData = $e->getExtraParams();
25 'error' => $errorMessage,
26 'error_code' => $errorCode,
27 'error_data' => $errorData,
35 * Function returns array of result expected from previous function.
40 function loc_block_get_expectedresult() {
42 $expectedResult = array(
56 'location_type_id' => '1',
59 'street_address' => '987654321',
60 'manual_geo_code' => 0,
64 'location_type_id' => '1',
65 'email' => 'test2@loc.block',
73 'location_type_id' => '1',
76 'phone' => '987654321',
77 'phone_numeric' => '987654321',
81 'location_type_id' => '1',
84 'phone' => '456-7890',
85 'phone_numeric' => '4567890',
91 return $expectedResult;
95 * This example has been generated from the API test suite.
96 * The test that created it is called "testCreateLocBlockEntities"
97 * and can be found at:
98 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/LocBlockTest.php
100 * You can see the outcome of the API tests at
101 * https://test.civicrm.org/job/CiviCRM-master-git/
103 * To Learn about the API read
104 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
106 * Browse the api on your own site with the api explorer
107 * http://MYSITE.ORG/path/to/civicrm/api
109 * Read more about testing here
110 * http://wiki.civicrm.org/confluence/display/CRM/Testing
112 * API Standards documentation:
113 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards