CRM-16523 towards fixing test issues on this
[civicrm-core.git] / api / v3 / Dashboard.php
index 784e478bfe916350cb7431d21815847818846874..c29b6604012a608f3ad0e7b1d2f791eb4e007ee4 100644 (file)
@@ -1,11 +1,9 @@
 <?php
-// $Id$
-
 /*
  +--------------------------------------------------------------------+
  | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
  */
 
 /**
- * File for the CiviCRM APIv3 Dashboard functions
+ * This api exposes CiviCRM Dashboard.
  *
  * @package CiviCRM_APIv3
- * @subpackage API_Activity
- * @copyright CiviCRM LLC (c) 2004-2014
- * @version $Id: Activity.php 30486 2010-11-02 16:12:09Z shot $
- *
  */
 
 
 /**
  * Creates or updates an Dashlet.
  *
- * @param array  $params array of property name/value
- *                             pairs for the Dashlet.
- *
- * @return array Array containing 'is_error' to denote success or failure and details of the created activity
+ * @param array $params
  *
+ * @return array
+ *   Array containing 'is_error' to denote success or failure and details of the created activity
  */
 function civicrm_api3_dashboard_create($params) {
   civicrm_api3_verify_one_mandatory($params, NULL, array(
@@ -59,41 +52,43 @@ function civicrm_api3_dashboard_create($params) {
 }
 
 /**
- * Specify Meta data for create. Note that this data is retrievable via the getfields function
+ * Specify Meta data for create.
+ *
+ * Note that this data is retrievable via the getfields function
  * and is used for pre-filling defaults and ensuring mandatory requirements are met.
- * @param array $params (reference) array of parameters determined by getfields
+ *
+ * @param array $params
+ *   array of parameters determined by getfields.
  */
 function _civicrm_api3_dashboard_create_spec(&$params) {
   unset($params['version']);
 }
 
 /**
- * Gets a CiviCRM Dashlets according to parameters
+ * Gets a CiviCRM Dashlets according to parameters.
  *
- * @param array  $params       Associative array of property name/value
- *                             pairs for the activity.
+ * @param array $params
  *
  * @return array
- *
  */
 function civicrm_api3_dashboard_get($params) {
   $bao = new CRM_Core_BAO_Dashboard();
-  _civicrm_api3_dao_set_filter($bao, $params, TRUE, 'Dashboard');
+  _civicrm_api3_dao_set_filter($bao, $params, TRUE);
   $dashlets = _civicrm_api3_dao_to_array($bao, $params, TRUE, 'Dashboard');
-  return civicrm_api3_create_success($dashlets, $params, 'dashboard', 'get', $bao);
+  return civicrm_api3_create_success($dashlets, $params, 'Dashboard', 'get', $bao);
 }
 
 /**
  * Delete a specified Dashlet.
  *
- * @param array $params array holding 'id' OR 'name' of dashlet to be deleted
- *
- * @return void|CRM_Core_Error  An error if 'name or ID' is invalid,
+ * @param array $params
+ *   Array holding 'id' of dashlet to be deleted.
  *
+ * @return array
  */
 function civicrm_api3_dashboard_delete($params) {
   if (CRM_Core_BAO_Dashboard::deleteDashlet($params['id'])) {
-    return civicrm_api3_create_success(1, $params, 'dashboard', 'delete');
+    return civicrm_api3_create_success(1, $params, 'Dashboard', 'delete');
   }
   else {
     return civicrm_api3_create_error('Could not delete dashlet');