+--------------------------------------------------------------------+
| CiviCRM version 5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2019 |
+ | Copyright CiviCRM LLC (c) 2004-2020 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
*
* @return array
* API result Array.
+ * @throws \CRM_Core_Exception
+ * @throws \API_Exception
*/
function civicrm_api3_event_create($params) {
// Required fields for creating an event
]);
}
- // 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']);
- }
-
_civicrm_api3_event_create_legacy_support_42($params);
return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'Event');
}
'id' => $row[$request['id_field']],
'label' => $row[$request['label_field']],
'description' => [
- CRM_Core_Pseudoconstant::getLabel('CRM_Event_BAO_Event', 'event_type_id', $row['event_type_id']),
+ CRM_Core_PseudoConstant::getLabel('CRM_Event_BAO_Event', 'event_type_id', $row['event_type_id']),
],
];
if (!empty($row['start_date'])) {