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',
69 'is_reserved' => array(
70 'name' => 'is_reserved',
74 'name' => 'is_tagset',
80 'title' => 'Used For',
84 'api.default' => 'civicrm_contact',
86 'created_id' => array(
87 'name' => 'created_id',
89 'FKClassName' => 'CRM_Contact_DAO_Contact',
91 'created_date' => array(
92 'name' => 'created_date',
94 'title' => 'Tag Created Date',
99 return $expectedResult;
104 * This example has been generated from the API test suite. The test that created it is called
106 * testTagGetfields and can be found in
107 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/TagTest.php
109 * You can see the outcome of the API tests at
110 * http://tests.dev.civicrm.org/trunk/results-api_v3
112 * To Learn about the API read
113 * http://book.civicrm.org/developer/current/techniques/api/
115 * and review the wiki at
116 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
118 * Read more about testing here
119 * http://wiki.civicrm.org/confluence/display/CRM/Testing
121 * API Standards documentation:
122 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards