Merge pull request #6397 from colemanw/CRM-14078
[civicrm-core.git] / api / v3 / Participant.php
index 654fb59d1d65d32ade8bda191b026eb7a9e8f896..7bca68fd963c794449c9b14f04b24a226ce5b249 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -60,7 +60,7 @@ function civicrm_api3_participant_create($params) {
   }
   _civicrm_api3_object_to_array($participantBAO, $participant[$participantBAO->id]);
 
-  return civicrm_api3_create_success($participant, $params, 'participant', 'create', $participantBAO);
+  return civicrm_api3_create_success($participant, $params, 'Participant', 'create', $participantBAO);
 }
 
 /**
@@ -158,9 +158,8 @@ function _civicrm_api3_participant_create_spec(&$params) {
  */
 function civicrm_api3_participant_get($params) {
   $mode = CRM_Contact_BAO_Query::MODE_EVENT;
-  $entity = 'participant';
 
-  list($dao, $query) = _civicrm_api3_get_query_object($params, $mode, $entity);
+  list($dao, $query) = _civicrm_api3_get_query_object($params, $mode, 'Participant');
 
   $participant = array();
   while ($dao->fetch()) {
@@ -169,7 +168,7 @@ function civicrm_api3_participant_get($params) {
     _civicrm_api3_custom_data_get($participant[$dao->participant_id], 'Participant', $dao->participant_id, NULL);
   }
 
-  return civicrm_api3_create_success($participant, $params, 'participant', 'get', $dao);
+  return civicrm_api3_create_success($participant, $params, 'Participant', 'get', $dao);
 }
 
 /**
@@ -181,8 +180,11 @@ function civicrm_api3_participant_get($params) {
  *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_participant_get_spec(&$params) {
-  $params['participant_test']['api.default'] = 0;
-  $params['participant_test']['title'] = 'Get Test Participants';
+  $params['participant_test'] = array(
+    'api.default' => 0,
+    'title' => 'Get Test Participants',
+    'type' => CRM_Utils_Type::T_BOOLEAN,
+  );
 }
 
 /**