CRM-16112 add type for api _spec functions
[civicrm-core.git] / api / v3 / Activity.php
index d140f2d94a68c110f0c369cf6752b8a6b75ca697..48cc1855726b812d228e57c37d45f1f5b8105605 100644 (file)
@@ -1,6 +1,4 @@
 <?php
-// $Id$
-
 /*
  +--------------------------------------------------------------------+
  | CiviCRM version 4.6                                                |
  */
 
 /**
- * File for the CiviCRM APIv3 activity functions
+ * This api exposes CiviCRM Activity records.
  *
  * @package CiviCRM_APIv3
- * @subpackage API_Activity
- * @copyright CiviCRM LLC (c) 2004-2014
- * @version $Id: Activity.php 30486 2010-11-02 16:12:09Z shot $
  */
 
 
@@ -41,7 +36,7 @@
  * Creates or updates an Activity.
  *
  * @param array $params
- *  Array per getfields documentation.
+ *   Array per getfields documentation.
  *
  * @throws API_Exception
  * @return array
@@ -170,7 +165,7 @@ function civicrm_api3_activity_create($params) {
     }
 
     _civicrm_api3_object_to_array($activityBAO, $activityArray[$activityBAO->id]);
-    return civicrm_api3_create_success($activityArray, $params, 'activity', 'get', $activityBAO);
+    return civicrm_api3_create_success($activityArray, $params, 'Activity', 'get', $activityBAO);
   }
 }
 
@@ -181,7 +176,7 @@ function civicrm_api3_activity_create($params) {
  * ensuring mandatory requirements are met.
  *
  * @param array $params
- *  Array of parameters determined by getfields.
+ *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_activity_create_spec(&$params) {
 
@@ -233,20 +228,20 @@ function civicrm_api3_activity_get($params) {
   else {
     $activities = _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params, FALSE);
   }
-  $options = _civicrm_api3_get_options_from_params($params, FALSE, 'activity', 'get');
+  $options = _civicrm_api3_get_options_from_params($params, FALSE, 'Activity', 'get');
   if ($options['is_count']) {
-    return civicrm_api3_create_success($activities, $params, 'activity', 'get');
+    return civicrm_api3_create_success($activities, $params, 'Activity', 'get');
   }
 
   $activities = _civicrm_api3_activity_get_formatResult($params, $activities);
   //legacy custom data get - so previous formatted response is still returned too
-  return civicrm_api3_create_success($activities, $params, 'activity', 'get');
+  return civicrm_api3_create_success($activities, $params, 'Activity', 'get');
 }
 
 /**
  * Given a list of activities, append any extra data requested about the activities.
  *
- * NOTE: Called by civicrm-core and CiviHR
+ * @note Called by civicrm-core and CiviHR
  *
  * @param array $params
  *   API request parameters.
@@ -319,10 +314,10 @@ function _civicrm_api3_activity_get_formatResult($params, $activities) {
 function civicrm_api3_activity_delete($params) {
 
   if (CRM_Activity_BAO_Activity::deleteActivity($params)) {
-    return civicrm_api3_create_success(1, $params, 'activity', 'delete');
+    return civicrm_api3_create_success(1, $params, 'Activity', 'delete');
   }
   else {
-    throw new API_Exception('Could not delete activity');
+    throw new API_Exception('Could not delete Activity');
   }
 }