3 * Test Generated example of using tag getlist API
4 * Demonstrates use of api.getlist for autocomplete and quicksearch applications *
6 function tag_getlist_example(){
15 $result = civicrm_api3('tag', 'getlist', $params);
17 catch (CiviCRM_API3_Exception
$e) {
19 $errorMessage = $e->getMessage();
20 $errorCode = $e->getErrorCode();
21 $errorData = $e->getExtraParams();
22 return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
29 * Function returns array of result expected from previous function
31 function tag_getlist_expectedresult(){
33 $expectedResult = array(
41 'label' => 'New Tag3',
42 'description' => array(
43 '0' => 'This is description for Our New Tag ',
46 'used_for' => 'civicrm_contact',
54 return $expectedResult;
59 * This example has been generated from the API test suite. The test that created it is called
61 * testTagGetList and can be found in
62 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/TagTest.php
64 * You can see the outcome of the API tests at
65 * https://test.civicrm.org/job/CiviCRM-master-git/
67 * To Learn about the API read
68 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
70 * Browse the api on your own site with the api explorer
71 * http://MYSITE.ORG/path/to/civicrm/api/explorer
73 * Read more about testing here
74 * http://wiki.civicrm.org/confluence/display/CRM/Testing
76 * API Standards documentation:
77 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards