Merge pull request #9616 from ErichBSchulz/feature/drupal_boot_no_exit
[civicrm-core.git] / api / v3 / examples / ActivityType / Get.php
1 <?php
2 /**
3 * Test Generated example demonstrating the ActivityType.get API.
4 *
5 * @deprecated
6 * The ActivityType api is deprecated. Please use the OptionValue api instead.
7 *
8 * @return array
9 * API result array
10 */
11 function activity_type_get_example() {
12 $params = array();
13
14 try{
15 $result = civicrm_api3('ActivityType', 'get', $params);
16 }
17 catch (CiviCRM_API3_Exception $e) {
18 // Handle error here.
19 $errorMessage = $e->getMessage();
20 $errorCode = $e->getErrorCode();
21 $errorData = $e->getExtraParams();
22 return array(
23 'is_error' => 1,
24 'error_message' => $errorMessage,
25 'error_code' => $errorCode,
26 'error_data' => $errorData,
27 );
28 }
29
30 return $result;
31 }
32
33 /**
34 * Function returns array of result expected from previous function.
35 *
36 * @return array
37 * API result array
38 */
39 function activity_type_get_expectedresult() {
40
41 $expectedResult = array(
42 'is_error' => 0,
43 'version' => 3,
44 'count' => 54,
45 'values' => array(
46 '1' => 'Meeting',
47 '2' => 'Phone Call',
48 '3' => 'Email',
49 '4' => 'Outbound SMS',
50 '5' => 'Event Registration',
51 '6' => 'Contribution',
52 '7' => 'Membership Signup',
53 '8' => 'Membership Renewal',
54 '9' => 'Tell a Friend',
55 '10' => 'Pledge Acknowledgment',
56 '11' => 'Pledge Reminder',
57 '12' => 'Inbound Email',
58 '13' => 'Open Case',
59 '14' => 'Follow up',
60 '15' => 'Change Case Type',
61 '16' => 'Change Case Status',
62 '17' => 'Membership Renewal Reminder',
63 '18' => 'Change Case Start Date',
64 '19' => 'Bulk Email',
65 '20' => 'Assign Case Role',
66 '21' => 'Remove Case Role',
67 '22' => 'Print/Merge Document',
68 '23' => 'Merge Case',
69 '24' => 'Reassigned Case',
70 '25' => 'Link Cases',
71 '26' => 'Change Case Tags',
72 '27' => 'Add Client To Case',
73 '28' => 'Survey',
74 '29' => 'Canvass',
75 '30' => 'PhoneBank',
76 '31' => 'WalkList',
77 '32' => 'Petition Signature',
78 '33' => 'Change Custom Data',
79 '34' => 'Mass SMS',
80 '35' => 'Change Membership Status',
81 '36' => 'Change Membership Type',
82 '37' => 'Cancel Recurring Contribution',
83 '38' => 'Update Recurring Contribution Billing Details',
84 '39' => 'Update Recurring Contribution',
85 '40' => 'Reminder Sent',
86 '41' => 'Export Accounting Batch',
87 '42' => 'Create Batch',
88 '43' => 'Edit Batch',
89 '44' => 'SMS delivery',
90 '45' => 'Inbound SMS',
91 '46' => 'Payment',
92 '47' => 'Refund',
93 '48' => 'Change Registration',
94 '49' => 'Downloaded Invoice',
95 '50' => 'Emailed Invoice',
96 '51' => 'Contact Merged',
97 '52' => 'Contact Deleted by Merge',
98 '53' => 'Failed Payment',
99 '54' => 'Close Accounting Period',
100 ),
101 'deprecated' => 'The ActivityType api is deprecated. Please use the OptionValue api instead.',
102 );
103
104 return $expectedResult;
105 }
106
107 /*
108 * This example has been generated from the API test suite.
109 * The test that created it is called "testActivityTypeGet"
110 * and can be found at:
111 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTypeTest.php
112 *
113 * You can see the outcome of the API tests at
114 * https://test.civicrm.org/job/CiviCRM-master-git/
115 *
116 * To Learn about the API read
117 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
118 *
119 * Browse the api on your own site with the api explorer
120 * http://MYSITE.ORG/path/to/civicrm/api
121 *
122 * Read more about testing here
123 * http://wiki.civicrm.org/confluence/display/CRM/Testing
124 *
125 * API Standards documentation:
126 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
127 */