Merge pull request #3679 from yashodha/CRM-14951
[civicrm-core.git] / api / v3 / ActivityType.php
index cc92b29102ce34a3364371a50bd259fa410f1caa..e70ce15d0d982c72e3afad00f07808925991c623 100644 (file)
@@ -1,10 +1,9 @@
 <?php
-
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.3                                                |
+ | CiviCRM version 4.5                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013                                |
+ | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -35,7 +34,7 @@
  * @package CiviCRM_APIv3
  * @subpackage API_Activity
  *
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
  * $Id: ActivityType.php 30171 2010-10-14 09:11:27Z mover $
  *
  */
 /**
  * Function to retrieve activity types
  *
+ * @param $params
+ *
  * @return array $activityTypes activity types keyed by id
  * @access public
  *
  * @example ActivityTypeGet.php
- * @deprecated - use constant_get
+ * @deprecated - use getoptions
  */
 function civicrm_api3_activity_type_get($params) {
 
-
   $activityTypes = CRM_Core_OptionGroup::values('activity_type');
   return civicrm_api3_create_success($activityTypes, $params, 'activity_type', 'get');
 }
@@ -66,14 +66,10 @@ function civicrm_api3_activity_type_get($params) {
  *
  * @access public
  *
- *{@schema Activity/ActivityType.xml}
- *
- * {@example ActivityTypeCreate.php 0}
  * @deprecated - we will introduce OptionValue Create - plse consider helping with this if not done
  */
 function civicrm_api3_activity_type_create($params) {
 
-
   $action = 1;
   $groupParams = array('name' => 'activity_type');
 
@@ -101,21 +97,15 @@ function _civicrm_api3_activity_type_create_spec(&$params) {
 /**
  * Function to delete activity type
  *
- * @param activityTypeId int   activity type id to delete
- *
- * @return boolen
+ * @param array $params array including id of activity_type to delete
+
+ * @return array API result array
  *
  * @access public
  *
  * @deprecated - we will introduce OptionValue Delete- plse consider helping with this if not done
- * {@example ActivityTypeDelete.php 0}
  */
 function civicrm_api3_activity_type_delete($params) {
-
-  civicrm_api3_verify_mandatory($params, NULL, array('activity_type_id'));
-
-  $activityTypeId = $params['activity_type_id'];
-
-  return CRM_Core_BAO_OptionValue::del($activityTypeId);
+  return civicrm_api3_create_success(CRM_Core_BAO_OptionValue::del($params['id']), $params);
 }