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(
45 'location_type_id' => '1',
48 'street_address' => '987654321',
49 'manual_geo_code' => 0,
53 'location_type_id' => '1',
54 'email' => 'test2@loc.block',
62 'location_type_id' => '1',
65 'phone' => '987654321',
66 'phone_numeric' => '987654321',
70 'location_type_id' => '1',
73 'phone' => '456-7890',
74 'phone_numeric' => '4567890',
80 return $expectedResult;
85 * This example has been generated from the API test suite. The test that created it is called
87 * testCreateLocBlockEntities and can be found in
88 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/LocBlockTest.php
90 * You can see the outcome of the API tests at
91 * http://tests.dev.civicrm.org/trunk/results-api_v3
93 * To Learn about the API read
94 * http://book.civicrm.org/developer/current/techniques/api/
96 * and review the wiki at
97 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
99 * Read more about testing here
100 * http://wiki.civicrm.org/confluence/display/CRM/Testing
102 * API Standards documentation:
103 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards