6 function activity_getfields_example(){
12 $result = civicrm_api( 'activity','getfields',$params );
18 * Function returns array of result expected from previous function
20 function activity_getfields_expectedresult(){
22 $expectedResult = array(
27 'source_record_id' => array(
28 'name' => 'source_record_id',
30 'title' => 'Source Record',
32 'activity_type_id' => array(
33 'name' => 'activity_type_id',
35 'title' => 'Activity Type ID',
38 'where' => 'civicrm_activity.activity_type_id',
39 'headerPattern' => '/(activity.)?type(.id$)/i',
40 'pseudoconstant' => array(
41 'optionGroupName' => 'activity_type',
44 'activity_date_time' => array(
45 'name' => 'activity_date_time',
47 'title' => 'Activity Date',
49 'where' => 'civicrm_activity.activity_date_time',
50 'headerPattern' => '/(activity.)?date(.time$)?/i',
56 'title' => 'Phone (called) ID',
57 'FKClassName' => 'CRM_Core_DAO_Phone',
59 'phone_number' => array(
60 'name' => 'phone_number',
62 'title' => 'Phone (called) Number',
66 'priority_id' => array(
67 'name' => 'priority_id',
69 'title' => 'Priority',
70 'pseudoconstant' => array(
71 'optionGroupName' => 'priority',
75 'name' => 'parent_id',
77 'title' => 'Parent Activity Id',
78 'FKClassName' => 'CRM_Activity_DAO_Activity',
85 'relationship_id' => array(
86 'name' => 'relationship_id',
88 'title' => 'Relationship Id',
90 'FKClassName' => 'CRM_Contact_DAO_Relationship',
92 'is_current_revision' => array(
93 'name' => 'is_current_revision',
95 'title' => 'Is this activity a current revision in versioning chain?',
97 'where' => 'civicrm_activity.is_current_revision',
98 'headerPattern' => '/(is.)?(current.)?(revision|version(ing)?)/i',
101 'original_id' => array(
102 'name' => 'original_id',
104 'title' => 'Original Activity ID ',
105 'FKClassName' => 'CRM_Activity_DAO_Activity',
115 'title' => 'Activity ID',
118 'where' => 'civicrm_activity.id',
120 'uniqueName' => 'activity_id',
121 'api.aliases' => array(
122 '0' => 'activity_id',
128 'title' => 'Subject',
132 'where' => 'civicrm_activity.subject',
133 'headerPattern' => '/(activity.)?subject/i',
135 'uniqueName' => 'activity_subject',
138 'name' => 'duration',
140 'title' => 'Duration',
142 'where' => 'civicrm_activity.duration',
143 'headerPattern' => '/(activity.)?duration(s)?$/i',
145 'uniqueName' => 'activity_duration',
148 'name' => 'location',
150 'title' => 'Location',
154 'where' => 'civicrm_activity.location',
155 'headerPattern' => '/(activity.)?location$/i',
157 'uniqueName' => 'activity_location',
162 'title' => 'Details',
166 'where' => 'civicrm_activity.details',
167 'headerPattern' => '/(activity.)?detail(s)?$/i',
169 'uniqueName' => 'activity_details',
171 'status_id' => array(
172 'name' => 'status_id',
174 'title' => 'Activity Status Id',
176 'where' => 'civicrm_activity.status_id',
177 'headerPattern' => '/(activity.)?status(.label$)?/i',
178 'pseudoconstant' => array(
179 'optionGroupName' => 'activity_status',
181 'uniqueName' => 'activity_status_id',
188 'where' => 'civicrm_activity.is_test',
189 'headerPattern' => '/(is.)?test(.activity)?/i',
191 'uniqueName' => 'activity_is_test',
193 'medium_id' => array(
194 'name' => 'medium_id',
196 'title' => 'Activity Medium',
198 'pseudoconstant' => array(
199 'optionGroupName' => 'encounter_medium',
201 'uniqueName' => 'activity_medium_id',
209 'uniqueName' => 'activity_result',
211 'is_deleted' => array(
212 'name' => 'is_deleted',
214 'title' => 'Activity is in the Trash',
216 'where' => 'civicrm_activity.is_deleted',
217 'headerPattern' => '/(activity.)?(trash|deleted)/i',
219 'uniqueName' => 'activity_is_deleted',
221 'campaign_id' => array(
222 'name' => 'campaign_id',
224 'title' => 'Campaign ID',
226 'where' => 'civicrm_activity.campaign_id',
228 'FKClassName' => 'CRM_Campaign_DAO_Campaign',
229 'uniqueName' => 'activity_campaign_id',
231 'engagement_level' => array(
232 'name' => 'engagement_level',
234 'title' => 'Engagement Index',
236 'where' => 'civicrm_activity.engagement_level',
238 'pseudoconstant' => array(
239 'optionGroupName' => 'engagement_index',
241 'uniqueName' => 'activity_engagement_level',
243 'source_contact_id' => array(
244 'name' => 'source_contact_id',
245 'title' => 'Activity Source Contact',
247 'FKClassName' => 'CRM_Activity_DAO_ActivityContact',
248 'api.default' => 'user_contact_id',
250 'assignee_contact_id' => array(
251 'name' => 'assignee_id',
252 'title' => 'assigned to',
254 'FKClassName' => 'CRM_Activity_DAO_ActivityContact',
256 'target_contact_id' => array(
257 'name' => 'target_id',
258 'title' => 'Activity Target',
260 'FKClassName' => 'CRM_Activity_DAO_ActivityContact',
265 return $expectedResult ;
270 * This example has been generated from the API test suite. The test that created it is called
272 * testGetFields and can be found in
273 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/ActivityTest.php
275 * You can see the outcome of the API tests at
276 * http://tests.dev.civicrm.org/trunk/results-api_v3
278 * To Learn about the API read
279 * http://book.civicrm.org/developer/current/techniques/api/
281 * and review the wiki at
282 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
284 * Read more about testing here
285 * http://wiki.civicrm.org/confluence/display/CRM/Testing
287 * API Standards documentation:
288 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards