}
}
- $values = $participant = array();
+ $values = $participant = [];
_civicrm_api3_custom_format_params($params, $values, 'Participant');
$params = array_merge($values, $params);
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',
'participant_count' => 0,
'unit_price' => $dao->amount,
'line_total' => $qty * $dao->amount,
- );
+ ];
civicrm_api3('line_item', 'create', $lineItemParams);
}
}
}
-
/**
* Adjust Metadata for Create action.
*
$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'];
}
/**
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);
* 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,
- );
+ ];
}
/**