3 * Test Generated example of using address get API
4 * Demonstrates Use of sort filter *
6 function address_get_example(){
9 'sort' => 'street_address DESC',
16 $result = civicrm_api3('address', 'get', $params);
18 catch (CiviCRM_API3_Exception
$e) {
20 $errorMessage = $e->getMessage();
21 $errorCode = $e->getErrorCode();
22 $errorData = $e->getExtraParams();
23 return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
30 * Function returns array of result expected from previous function
32 function address_get_expectedresult(){
34 $expectedResult = array(
42 'location_type_id' => '14',
45 'street_address' => 'Ambachtstraat 23',
46 'street_number' => '23',
47 'street_name' => 'Ambachtstraat',
49 'postal_code' => '6971 BN',
50 'country_id' => '1152',
51 'manual_geo_code' => 0,
56 'location_type_id' => '1',
59 'street_address' => '15 Main St',
60 'street_number' => '15',
61 'street_number_suffix' => 'S',
62 'street_name' => 'Main',
63 'street_type' => 'St',
64 'city' => 'Collinsville',
65 'state_province_id' => '1006',
66 'postal_code' => '6022',
67 'country_id' => '1228',
68 'geo_code_1' => '41.8328',
69 'geo_code_2' => '-72.9253',
70 'manual_geo_code' => 0,
75 return $expectedResult;
80 * This example has been generated from the API test suite. The test that created it is called
82 * testGetAddressSort and can be found in
83 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/AddressTest.php
85 * You can see the outcome of the API tests at
86 * http://tests.dev.civicrm.org/trunk/results-api_v3
88 * To Learn about the API read
89 * http://book.civicrm.org/developer/current/techniques/api/
91 * and review the wiki at
92 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
94 * Read more about testing here
95 * http://wiki.civicrm.org/confluence/display/CRM/Testing
97 * API Standards documentation:
98 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards