Merge pull request #1035 from GiantRobot/CRM-12720
[civicrm-core.git] / api / v3 / Case.php
index 7e465b482d9da9900501232b96fcb314fb325d5a..856b335a4e64780d9d19e0e0159d9fe059baa614 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-// $Id$
 
 /*
   +--------------------------------------------------------------------+
@@ -187,6 +186,10 @@ function _civicrm_api3_case_delete_spec(&$params) {
  * @todo Erik Hommel 16 dec 2010 check if all DB fields are returned
  */
 function civicrm_api3_case_get($params) {
+  civicrm_api3_verify_mandatory($params, NULL, array(
+    array('case_id', 'contact_id', 'activity_id', 'contact_id')
+  ));
+
   $options = _civicrm_api3_get_options_from_params($params);
 
   // Get by id
@@ -258,8 +261,6 @@ SELECT DISTINCT case_id
     }
     return civicrm_api3_create_success($cases, $params, 'case', 'get');
   }
-
-  return civicrm_api3_create_error('Missing required parameter. Must provide case_id, contact_id, activity_id, or contact_id.');
 }
 
 /**