3 * Test Generated example of using tag getfields API
4 * demonstrate use of getfields to interogate api *
6 function tag_getfields_example(){
12 $result = civicrm_api3('tag', 'getfields', $params);
14 catch (CiviCRM_API3_Exception
$e) {
16 $errorMessage = $e->getMessage();
17 $errorCode = $e->getErrorCode();
18 $errorData = $e->getExtraParams();
19 return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
26 * Function returns array of result expected from previous function
28 function tag_getfields_expectedresult(){
30 $expectedResult = array(
39 'api.aliases' => array(
52 'description' => array(
53 'name' => 'description',
55 'title' => 'Description',
60 'name' => 'parent_id',
63 'FKClassName' => 'CRM_Core_DAO_Tag',
65 'is_selectable' => array(
66 'name' => 'is_selectable',
70 'is_reserved' => array(
71 'name' => 'is_reserved',
75 'name' => 'is_tagset',
81 'title' => 'Used For',
85 'api.default' => 'civicrm_contact',
87 'created_id' => array(
88 'name' => 'created_id',
90 'FKClassName' => 'CRM_Contact_DAO_Contact',
92 'created_date' => array(
93 'name' => 'created_date',
95 'title' => 'Tag Created Date',
100 return $expectedResult;
105 * This example has been generated from the API test suite. The test that created it is called
107 * testTagGetfields and can be found in
108 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/TagTest.php
110 * You can see the outcome of the API tests at
111 * https://test.civicrm.org/job/CiviCRM-master-git/
113 * To Learn about the API read
114 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
116 * Browse the api on your own site with the api explorer
117 * http://MYSITE.ORG/path/to/civicrm/api/explorer
119 * Read more about testing here
120 * http://wiki.civicrm.org/confluence/display/CRM/Testing
122 * API Standards documentation:
123 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards