4 demonstrate use of getfields to interogate api
6 function group_getfields_example(){
12 $result = civicrm_api( 'group','getfields',$params );
18 * Function returns array of result expected from previous function
20 function group_getfields_expectedresult(){
22 $expectedResult = array(
30 'title' => 'Group ID',
32 'api.aliases' => array(
39 'title' => 'Group Name',
46 'title' => 'Group Title',
51 'description' => array(
52 'name' => 'description',
54 'title' => 'Group Description',
61 'title' => 'Group Source',
65 'saved_search_id' => array(
66 'name' => 'saved_search_id',
68 'title' => 'Saved Search ID',
69 'FKClassName' => 'CRM_Contact_DAO_SavedSearch',
72 'name' => 'is_active',
74 'title' => 'Group Enabled',
77 'visibility' => array(
78 'name' => 'visibility',
80 'title' => 'Group Visibility Setting',
81 'default' => 'User and User Admin Only',
82 'enumValues' => 'User and User Admin Only,Public Pages',
84 'where_clause' => array(
85 'name' => 'where_clause',
87 'title' => 'Group Where Clause',
89 'select_tables' => array(
90 'name' => 'select_tables',
92 'title' => 'Tables For Select Clause',
94 'where_tables' => array(
95 'name' => 'where_tables',
97 'title' => 'Tables For Where Clause',
99 'group_type' => array(
100 'name' => 'group_type',
102 'title' => 'Group Type',
106 'cache_date' => array(
107 'name' => 'cache_date',
109 'title' => 'Group Cache Date',
111 'refresh_date' => array(
112 'name' => 'refresh_date',
114 'title' => 'Next Group Refresh Time',
119 'title' => 'Group Parents',
122 'name' => 'children',
124 'title' => 'Group Children',
126 'is_hidden' => array(
127 'name' => 'is_hidden',
129 'title' => 'Group is Hidden',
131 'is_reserved' => array(
132 'name' => 'is_reserved',
134 'title' => 'Group is Reserved',
136 'created_id' => array(
137 'name' => 'created_id',
139 'title' => 'Group Created By',
140 'FKClassName' => 'CRM_Contact_DAO_Contact',
145 return $expectedResult ;
150 * This example has been generated from the API test suite. The test that created it is called
152 * testgetfields and can be found in
153 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/GroupTest.php
155 * You can see the outcome of the API tests at
156 * http://tests.dev.civicrm.org/trunk/results-api_v3
158 * To Learn about the API read
159 * http://book.civicrm.org/developer/current/techniques/api/
161 * and review the wiki at
162 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
164 * Read more about testing here
165 * http://wiki.civicrm.org/confluence/display/CRM/Testing
167 * API Standards documentation:
168 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards