4 /*this demonstrates the usage of chained api functions. A variety of return formats are used. Note that no notes
5 *custom fields or memberships exist
7 function contact_get_example(){
11 'api.website.getValue' => array(
14 'api.Contribution.getCount' => array(),
15 'api.CustomValue.get' => 1,
17 'api.Membership.getCount' => array(),
20 $result = civicrm_api( 'contact','get',$params );
26 * Function returns array of result expected from previous function
28 function contact_get_expectedresult(){
30 $expectedResult = array(
38 'contact_type' => 'Individual',
39 'contact_sub_type' => '',
40 'sort_name' => 'xyz3, abc3',
41 'display_name' => 'abc3 xyz3',
48 'legal_identifier' => '',
49 'external_identifier' => '',
53 'preferred_mail_format' => 'Both',
54 'first_name' => 'abc3',
56 'last_name' => 'xyz3',
60 'deceased_date' => '',
61 'household_name' => '',
62 'organization_name' => '',
64 'contact_is_deleted' => 0,
65 'current_employer' => '',
67 'street_address' => '',
68 'supplemental_address_1' => '',
69 'supplemental_address_2' => '',
71 'postal_code_suffix' => '',
75 'state_province_id' => '',
76 'state_province_name' => '',
77 'state_province' => '',
81 'phone_type_id' => '',
84 'email' => 'man3@yahoo.com',
89 'worldregion_id' => '',
92 'api.website.getValue' => 'http://civicrm.org',
93 'api.Contribution.getCount' => 2,
94 'api.CustomValue.get' => array(
100 'api.Note.get' => array(
106 'api.Membership.getCount' => 0,
111 return $expectedResult ;
116 * This example has been generated from the API test suite. The test that created it is called
118 * testGetIndividualWithChainedArraysFormats and can be found in
119 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/ContactTest.php
121 * You can see the outcome of the API tests at
122 * http://tests.dev.civicrm.org/trunk/results-api_v3
124 * To Learn about the API read
125 * http://book.civicrm.org/developer/current/techniques/api/
127 * and review the wiki at
128 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
130 * Read more about testing here
131 * http://wiki.civicrm.org/confluence/display/CRM/Testing
133 * API Standards documentation:
134 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards