$copy = CRM_Event_BAO_Event::copy($params['template_id']);
$params['id'] = $copy->id;
unset($params['template_id']);
- if (empty($params['is_template'])) {
- $params['is_template'] = 0;
- }
}
_civicrm_api3_event_create_legacy_support_42($params);
-
- //format custom fields so they can be added
- $values = array();
- _civicrm_api3_custom_format_params($params, $values, 'Event');
- $params = array_merge($values, $params);
-
- $eventBAO = CRM_Event_BAO_Event::create($params);
- $event = array();
- _civicrm_api3_object_to_array($eventBAO, $event[$eventBAO->id]);
- return civicrm_api3_create_success($event, $params);
+ return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'Event');
}
/**
// the return.is_full to deal with.
// NB the std dao_to_array function should only return custom if required.
$event = array();
+ $options = _civicrm_api3_get_options_from_params($params);
+
$eventDAO->find();
while ($eventDAO->fetch()) {
$event[$eventDAO->id] = array();
}
_civicrm_api3_event_get_legacy_support_42($event, $eventDAO->id);
_civicrm_api3_custom_data_get($event[$eventDAO->id], 'Event', $eventDAO->id, NULL, $eventDAO->event_type_id);
+ if(!empty($options['return'])) {
+ $event[$eventDAO->id]['price_set_id'] = CRM_Price_BAO_PriceSet::getFor('civicrm_event', $eventDAO->id);
+ }
}
//end of the loop
* @param int $event_id Id of the event to be updated
*
*/
+/**
+ * @param $event
+ * @param $event_id
+ */
function _civicrm_api3_event_getisfull(&$event, $event_id) {
$eventFullResult = CRM_Event_BAO_Participant::eventFull($event_id, 1);
if (!empty($eventFullResult) && is_int($eventFullResult)) {