4 /*this demonstrates the usage of chained api functions. A variety of techniques are used
6 function contact_get_example(){
10 'api.website.getValue' => array(
13 'api.Contribution.getCount' => array(),
14 'api.CustomValue.get' => 1,
17 $result = civicrm_api( 'contact','get',$params );
23 * Function returns array of result expected from previous function
25 function contact_get_expectedresult(){
27 $expectedResult = array(
35 'contact_type' => 'Individual',
36 'contact_sub_type' => '',
37 'sort_name' => 'xyz3, abc3',
38 'display_name' => 'abc3 xyz3',
45 'legal_identifier' => '',
46 'external_identifier' => '',
50 'preferred_mail_format' => 'Both',
51 'first_name' => 'abc3',
53 'last_name' => 'xyz3',
57 'deceased_date' => '',
58 'household_name' => '',
59 'organization_name' => '',
61 'contact_is_deleted' => 0,
62 'current_employer' => '',
64 'street_address' => '',
65 'supplemental_address_1' => '',
66 'supplemental_address_2' => '',
68 'postal_code_suffix' => '',
72 'state_province_id' => '',
73 'state_province_name' => '',
74 'state_province' => '',
78 'phone_type_id' => '',
81 'email' => 'man3@yahoo.com',
86 'worldregion_id' => '',
89 'api.website.getValue' => 'http://civicrm.org',
90 'api.Contribution.getCount' => 2,
91 'api.CustomValue.get' => array(
98 'latest' => 'value 4',
103 'entity_table' => 'Contact',
107 'latest' => 'value 3',
113 'entity_table' => 'Contact',
130 'entity_table' => 'Contact',
140 'latest' => 'vegemite',
156 return $expectedResult ;
161 * This example has been generated from the API test suite. The test that created it is called
163 * testGetIndividualWithChainedArraysAndMultipleCustom and can be found in
164 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/ContactTest.php
166 * You can see the outcome of the API tests at
167 * http://tests.dev.civicrm.org/trunk/results-api_v3
169 * To Learn about the API read
170 * http://book.civicrm.org/developer/current/techniques/api/
172 * and review the wiki at
173 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
175 * Read more about testing here
176 * http://wiki.civicrm.org/confluence/display/CRM/Testing
178 * API Standards documentation:
179 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards