ea2cd37f3d408dffa5f1c733b0547a982c7b8e4e
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',
41 'activity_date_time' => array(
42 'name' => 'activity_date_time',
44 'title' => 'Activity Date',
46 'where' => 'civicrm_activity.activity_date_time',
47 'headerPattern' => '/(activity.)?date(.time$)?/i',
53 'title' => 'Phone (called) ID',
54 'FKClassName' => 'CRM_Core_DAO_Phone',
56 'phone_number' => array(
57 'name' => 'phone_number',
59 'title' => 'Phone (called) Number',
63 'priority_id' => array(
64 'name' => 'priority_id',
66 'title' => 'Priority',
67 'pseudoconstant' => array(
69 'optionGroupName' => 'priority',
71 'api.aliases' => array(
81 'name' => 'parent_id',
83 'title' => 'Parent Activity Id',
84 'FKClassName' => 'CRM_Activity_DAO_Activity',
91 'relationship_id' => array(
92 'name' => 'relationship_id',
94 'title' => 'Relationship Id',
96 'FKClassName' => 'CRM_Contact_DAO_Relationship',
98 'is_current_revision' => array(
99 'name' => 'is_current_revision',
101 'title' => 'Is this activity a current revision in versioning chain?',
103 'where' => 'civicrm_activity.is_current_revision',
104 'headerPattern' => '/(is.)?(current.)?(revision|version(ing)?)/i',
107 'original_id' => array(
108 'name' => 'original_id',
110 'title' => 'Original Activity ID ',
111 'FKClassName' => 'CRM_Activity_DAO_Activity',
121 'title' => 'Activity ID',
124 'where' => 'civicrm_activity.id',
126 'uniqueName' => 'activity_id',
127 'api.aliases' => array(
128 '0' => 'activity_id',
134 'title' => 'Subject',
138 'where' => 'civicrm_activity.subject',
139 'headerPattern' => '/(activity.)?subject/i',
141 'uniqueName' => 'activity_subject',
144 'name' => 'duration',
146 'title' => 'Duration',
148 'where' => 'civicrm_activity.duration',
149 'headerPattern' => '/(activity.)?duration(s)?$/i',
151 'uniqueName' => 'activity_duration',
154 'name' => 'location',
156 'title' => 'Location',
160 'where' => 'civicrm_activity.location',
161 'headerPattern' => '/(activity.)?location$/i',
163 'uniqueName' => 'activity_location',
168 'title' => 'Details',
172 'where' => 'civicrm_activity.details',
173 'headerPattern' => '/(activity.)?detail(s)?$/i',
175 'uniqueName' => 'activity_details',
177 'status_id' => array(
178 'name' => 'status_id',
180 'title' => 'Activity Status Id',
182 'where' => 'civicrm_activity.status_id',
183 'headerPattern' => '/(activity.)?status(.label$)?/i',
184 'uniqueName' => 'activity_status_id',
191 'where' => 'civicrm_activity.is_test',
192 'headerPattern' => '/(is.)?test(.activity)?/i',
194 'uniqueName' => 'activity_is_test',
196 'medium_id' => array(
197 'name' => 'medium_id',
199 'title' => 'Activity 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 'uniqueName' => 'activity_engagement_level',
240 'source_contact_id' => array(
241 'api.default' => 'user_contact_id',
243 'assignee_contact_id' => array(
244 'name' => 'assignee_id',
245 'title' => 'assigned to',
247 'FKClassName' => 'CRM_Activity_DAO_ActivityAssignment',
249 'target_contact_id' => array(
250 'name' => 'target_id',
251 'title' => 'Activity Target',
253 'FKClassName' => 'CRM_Activity_DAO_ActivityTarget',
255 'activity_status_id' => array(
256 'name' => 'status_id',
257 'title' => 'Status Id',
263 return $expectedResult ;
268 * This example has been generated from the API test suite. The test that created it is called
270 * testGetFields and can be found in
271 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/ActivityTest.php
273 * You can see the outcome of the API tests at
274 * http://tests.dev.civicrm.org/trunk/results-api_v3
276 * To Learn about the API read
277 * http://book.civicrm.org/developer/current/techniques/api/
279 * and review the wiki at
280 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
282 * Read more about testing here
283 * http://wiki.civicrm.org/confluence/display/CRM/Testing
285 * API Standards documentation:
286 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards