+ civicrm_api3_verify_one_mandatory($params, NULL, array('event_type_id', 'template_id'));
+
+ // Clone event from template
+ if (!empty($params['template_id']) && empty($params['id'])) {
+ $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;
+ }
+ }