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 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/TagTest.php
110 * You can see the outcome of the API tests at
111 * http://tests.dev.civicrm.org/trunk/results-api_v3
113 * To Learn about the API read
114 * http://book.civicrm.org/developer/current/techniques/api/
116 * and review the wiki at
117 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
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