3 * Test Generated example demonstrating the ActivityType.create API.
6 * The ActivityType api is deprecated. Please use the OptionValue api instead.
11 function activity_type_create_example() {
14 'label' => 'send out letters',
22 $result = civicrm_api3('ActivityType', 'create', $params);
24 catch (CiviCRM_API3_Exception
$e) {
26 $errorMessage = $e->getMessage();
27 $errorCode = $e->getErrorCode();
28 $errorData = $e->getExtraParams();
31 'error_message' => $errorMessage,
32 'error_code' => $errorCode,
33 'error_data' => $errorData,
41 * Function returns array of result expected from previous function.
46 function activity_type_create_expectedresult() {
48 $expectedResult = array(
56 'option_group_id' => '2',
57 'label' => 'send out letters',
59 'name' => 'send out letters',
70 'visibility_id' => '',
75 'deprecated' => 'The ActivityType api is deprecated. Please use the OptionValue api instead.',
78 return $expectedResult;
82 * This example has been generated from the API test suite.
83 * The test that created it is called "testActivityTypeCreate"
84 * and can be found at:
85 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTypeTest.php
87 * You can see the outcome of the API tests at
88 * https://test.civicrm.org/job/CiviCRM-master-git/
90 * To Learn about the API read
91 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
93 * Browse the api on your own site with the api explorer
94 * http://MYSITE.ORG/path/to/civicrm/api
96 * Read more about testing here
97 * http://wiki.civicrm.org/confluence/display/CRM/Testing
99 * API Standards documentation:
100 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards