Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | ||
3 | /* | |
4 | This demonstrates use of the 'format.is_success' param. | |
5 | This param causes only the success or otherwise of the function to be returned as BOOLEAN | |
6 | */ | |
7 | function contact_get_example(){ | |
edb0d67a | 8 | $params = array( |
6a488035 TO |
9 | 'version' => 3, |
10 | 'id' => 17, | |
11 | 'format.is_success' => 1, | |
12 | ); | |
13 | ||
14 | $result = civicrm_api( 'contact','get',$params ); | |
15 | ||
16 | return $result; | |
17 | } | |
18 | ||
19 | /* | |
20 | * Function returns array of result expected from previous function | |
21 | */ | |
22 | function contact_get_expectedresult(){ | |
23 | ||
24 | $expectedResult = 1; | |
25 | ||
26 | return $expectedResult ; | |
27 | } | |
28 | ||
29 | ||
30 | /* | |
31 | * This example has been generated from the API test suite. The test that created it is called | |
32 | * | |
33 | * testContactGetFormatIsSuccessTrue and can be found in | |
34 | * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/ContactTest.php | |
35 | * | |
36 | * You can see the outcome of the API tests at | |
37 | * http://tests.dev.civicrm.org/trunk/results-api_v3 | |
38 | * | |
39 | * To Learn about the API read | |
40 | * http://book.civicrm.org/developer/current/techniques/api/ | |
41 | * | |
42 | * and review the wiki at | |
43 | * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs | |
44 | * | |
45 | * Read more about testing here | |
46 | * http://wiki.civicrm.org/confluence/display/CRM/Testing | |
47 | * | |
48 | * API Standards documentation: | |
49 | * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards | |
50 | */ |