3 * Test Generated example demonstrating the Profile.get API.
8 function profile_get_example() {
19 $result = civicrm_api3('Profile', 'get', $params);
21 catch (CiviCRM_API3_Exception
$e) {
23 $errorMessage = $e->getMessage();
24 $errorCode = $e->getErrorCode();
25 $errorData = $e->getExtraParams();
28 'error_message' => $errorMessage,
29 'error_code' => $errorCode,
30 'error_data' => $errorData,
38 * Function returns array of result expected from previous function.
43 function profile_get_expectedresult() {
51 'postal_code-1' => '90210',
52 'state_province-1' => '1021',
53 'country-1' => '1228',
54 'phone-1-1' => '021 512 755',
55 'email-Primary' => 'abc1.xyz1@yahoo.com',
56 'last_name' => 'xyz1',
57 'first_name' => 'abc1',
58 'email-primary' => 'abc1.xyz1@yahoo.com',
61 'first_name' => 'abc1',
62 'last_name' => 'xyz1',
63 'street_address-1' => '5 Saint Helier St',
64 'city-1' => 'Gotham City',
65 'postal_code-1' => '90210',
66 'country-1' => '1228',
67 'state_province-1' => '1021',
70 'billing_first_name' => 'abc1',
71 'billing_middle_name' => 'J.',
72 'billing_last_name' => 'xyz1',
73 'billing_street_address-5' => '5 Saint Helier St',
74 'billing_city-5' => 'Gotham City',
75 'billing_state_province_id-5' => '1021',
76 'billing_country_id-5' => '1228',
77 'billing_postal_code-5' => '90210',
78 'billing-email-5' => 'abc1.xyz1@yahoo.com',
79 'email-5' => 'abc1.xyz1@yahoo.com',
84 return $expectedResult;
88 * This example has been generated from the API test suite.
89 * The test that created it is called "testProfileGetMultiple"
90 * and can be found at:
91 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ProfileTest.php
93 * You can see the outcome of the API tests at
94 * https://test.civicrm.org/job/CiviCRM-Core-Matrix/
96 * To Learn about the API read
97 * https://docs.civicrm.org/dev/en/latest/api/
99 * Browse the API on your own site with the API Explorer. It is in the main
100 * CiviCRM menu, under: Support > Development > API Explorer.
102 * Read more about testing here
103 * https://docs.civicrm.org/dev/en/latest/testing/
105 * API Standards documentation:
106 * https://docs.civicrm.org/dev/en/latest/framework/api-architecture/