Merge pull request #4819 from eileenmcnaughton/CRM-15680
[civicrm-core.git] / api / v3 / CaseType.php
index 654f20ce1a715ed371672124fbedd9f3a6d1acea..d30af7c13947e49ce82170929c3ae5a4816f938c 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
   +--------------------------------------------------------------------+
-  | CiviCRM version 4.5                                                |
+  | CiviCRM version 4.6                                                |
   +--------------------------------------------------------------------+
   | Copyright CiviCRM LLC (c) 2004-2014                                |
   +--------------------------------------------------------------------+
@@ -36,7 +36,7 @@
  */
 
 /**
- * Function to create or update case type
+ * create or update case type
  *
  * @param  array $params   input parameters
  *
@@ -68,23 +68,24 @@ function civicrm_api3_case_type_create($params) {
 }
 
 /**
- * Function to retrieve case types
+ * retrieve case types
  *
- * @param $params
+ * @param array $params
  *
  * @return array $caseTypes case types keyed by id
  * @access public
  */
 function civicrm_api3_case_type_get($params) {
-  civicrm_api3_verify_mandatory($params);
+  if (!empty($params['options']) && !empty($params['options']['is_count'])) {
+    return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
+  }
   $caseTypes = _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
-
   // format case type, to fetch xml definition
   return _civicrm_api3_case_type_get_formatResult($caseTypes);
 }
 
 /**
- * Function to format definition
+ * format definition
  *
  * @param $caseTypes
  * @return mixed