4 * Test Generated API Example.
5 * See bottom of this file for more detail.
9 * Test Generated example of using contact getcount API.
11 * This demonstrates use of the 'getCount' action.
13 * This param causes the count of the only function to be returned as an integer.
18 function contact_getcount_example() {
24 $result = civicrm_api3('contact', 'getcount', $params);
26 catch (CiviCRM_API3_Exception
$e) {
28 $errorMessage = $e->getMessage();
29 $errorCode = $e->getErrorCode();
30 $errorData = $e->getExtraParams();
32 'error' => $errorMessage,
33 'error_code' => $errorCode,
34 'error_data' => $errorData,
42 * Function returns array of result expected from previous function.
47 function contact_getcount_expectedresult() {
51 return $expectedResult;
55 * This example has been generated from the API test suite.
56 * The test that created it is called
57 * testContactGetFormatCount_only
59 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
61 * You can see the outcome of the API tests at
62 * https://test.civicrm.org/job/CiviCRM-master-git/
64 * To Learn about the API read
65 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
67 * Browse the api on your own site with the api explorer
68 * http://MYSITE.ORG/path/to/civicrm/api/explorer
70 * Read more about testing here
71 * http://wiki.civicrm.org/confluence/display/CRM/Testing
73 * API Standards documentation:
74 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards