3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
13 * The ActivityType api is deprecated. Please use the OptionValue api instead.
17 * @package CiviCRM_APIv3
21 * Notification of deprecated function.
23 * @deprecated api notice
25 * to indicate this entire api entity is deprecated
27 function _civicrm_api3_activity_type_deprecation() {
28 return 'The ActivityType api is deprecated. Please use the OptionValue api instead.';
32 * Retrieve activity types.
34 * @param array $params
37 * activity types keyed by id
38 * @deprecated - use the getoptions action instead
40 function civicrm_api3_activity_type_get($params) {
42 $activityTypes = CRM_Core_OptionGroup
::values('activity_type');
43 return civicrm_api3_create_success($activityTypes, $params, 'activity_type', 'get');
47 * Create activity type.
49 * @param array $params
52 * created / updated activity type
54 * @deprecated use the OptionValue api instead
56 function civicrm_api3_activity_type_create($params) {
60 if ($optionValueID = CRM_Utils_Array
::value('option_value_id', $params)) {
64 $activityObject = CRM_Core_OptionValue
::addOptionValue($params, 'activity_type', $action, $optionValueID);
66 _civicrm_api3_object_to_array($activityObject, $activityType[$activityObject->id
]);
67 return civicrm_api3_create_success($activityType, $params, 'activity_type', 'create');
71 * Adjust Metadata for Create action.
73 * The metadata is used for setting defaults, documentation & validation.
75 * @param array $params
76 * Array of parameters determined by getfields.
78 function _civicrm_api3_activity_type_create_spec(&$params) {
82 'type' => CRM_Utils_Type
::T_STRING
,
87 'type' => CRM_Utils_Type
::T_STRING
,
92 * Delete ActivityType.
94 * @param array $params
95 * Array including id of activity_type to delete.
96 * @return array API result array
97 * @throws API_Exception
98 * @deprecated use OptionValue api
100 function civicrm_api3_activity_type_delete($params) {
101 $result = CRM_Core_BAO_OptionValue
::del($params['id']);
103 return civicrm_api3_create_success(TRUE, $params);
105 throw new API_Exception("Failure to delete activity type id {$params['id']}");