X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=api%2Fv3%2FParticipant.php;h=368525482511d188ba94baf701c8b7653b9e734b;hb=3e46951c9b58ae37787351fb840bd396457b2d80;hp=8f91fbcf424b680e83097cd85cb7ecafa283d618;hpb=c9baa85a27f776bc2b49bc5d38611f537cf19f30;p=civicrm-core.git diff --git a/api/v3/Participant.php b/api/v3/Participant.php index 8f91fbcf42..3685254825 100644 --- a/api/v3/Participant.php +++ b/api/v3/Participant.php @@ -3,7 +3,7 @@ +--------------------------------------------------------------------+ | CiviCRM version 5 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2017 | + | Copyright CiviCRM LLC (c) 2004-2019 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -49,7 +49,7 @@ function civicrm_api3_participant_create($params) { } } - $values = $participant = array(); + $values = $participant = []; _civicrm_api3_custom_format_params($params, $values, 'Participant'); $params = array_merge($values, $params); @@ -104,14 +104,14 @@ function _civicrm_api3_participant_createlineitem(&$params, $participant) { where ps.id is not null and pfv.label = %2 "; - $qParams = array( - 1 => array($params['event_id'], 'Integer'), - 2 => array($label, 'String'), - ); + $qParams = [ + 1 => [$params['event_id'], 'Integer'], + 2 => [$label, 'String'], + ]; $dao = CRM_Core_DAO::executeQuery($sql, $qParams); if ($dao->fetch()) { - $lineItemParams = array( + $lineItemParams = [ 'price_field_id' => $dao->priceFieldID, 'price_field_value_id' => $dao->priceFieldValueID, 'entity_table' => 'civicrm_participant', @@ -121,14 +121,13 @@ function _civicrm_api3_participant_createlineitem(&$params, $participant) { 'participant_count' => 0, 'unit_price' => $dao->amount, 'line_total' => $qty * $dao->amount, - ); + ]; civicrm_api3('line_item', 'create', $lineItemParams); } } } - /** * Adjust Metadata for Create action. * @@ -143,8 +142,8 @@ function _civicrm_api3_participant_create_spec(&$params) { $params['event_id']['api.required'] = 1; $params['contact_id']['api.required'] = 1; // These are for the sake of search builder options - can be removed if that is fixed - $params['role_id']['api.aliases'] = array('participant_role'); - $params['status_id']['api.aliases'] = array('participant_status'); + $params['role_id']['api.aliases'] = ['participant_role']; + $params['status_id']['api.aliases'] = ['participant_status']; } /** @@ -161,7 +160,7 @@ function civicrm_api3_participant_get($params) { list($dao, $query) = _civicrm_api3_get_query_object($params, $mode, 'Participant'); - $participant = array(); + $participant = []; while ($dao->fetch()) { $query->convertToPseudoNames($dao, FALSE, TRUE); $participant[$dao->participant_id] = $query->store($dao); @@ -181,11 +180,11 @@ function civicrm_api3_participant_get($params) { * Array of parameters determined by getfields. */ function _civicrm_api3_participant_get_spec(&$params) { - $params['participant_test'] = array( + $params['participant_test'] = [ 'api.default' => 0, 'title' => 'Get Test Participants', 'type' => CRM_Utils_Type::T_BOOLEAN, - ); + ]; } /**