* @param array $params
* An associative array of name/value property values of civicrm_participant.
*
- * @return array apiresult
+ * @return array
+ * apiresult
* {@getfields participant_create}
* @access public
*/
}
}
- $value = array();
+ $values = $participant = array();
_civicrm_api3_custom_format_params($params, $values, 'Participant');
$params = array_merge($values, $params);
}
/**
+ * @todo this should be done in the BAO not the api
* Create a default participant line item
*/
function _civicrm_api3_participant_createlineitem(&$params, $participant) {
$dao = CRM_Core_DAO::executeQuery($sql, $qParams);
if ($dao->fetch()) {
- $lineItemparams = array(
+ $lineItemParams = array(
'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,
- 'version' => 3,
);
- civicrm_api('line_item', 'create', $lineItemparams);
+ civicrm_api3('line_item', 'create', $lineItemParams);
}
}
* @param array $params
* (reference ) input parameters.
*
- * @return array (reference ) array of properties, if error an array with an error id and error message
+ * @return array
+ * (reference ) array of properties, if error an array with an error id and error message
* {@getfields participant_get}
* @access public
*/