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