+--------------------------------------------------------------------+
| CiviCRM version 5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2018 |
+ | Copyright CiviCRM LLC (c) 2004-2019 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2018
+ * @copyright CiviCRM LLC (c) 2004-2019
*/
class CRM_Event_BAO_Event extends CRM_Event_DAO_Event {
* @return CRM_Event_DAO_Event
* @throws \CRM_Core_Exception
*/
- public static function copy($id) {
+ public static function copy($id, $params = []) {
$eventValues = array();
//get the require event values.
$copyEvent = CRM_Core_DAO::copyGeneric('CRM_Event_DAO_Event',
array('id' => $id),
// since the location is sharable, lets use the same loc_block_id.
- array('loc_block_id' => CRM_Utils_Array::value('loc_block_id', $eventValues)),
+ array('loc_block_id' => CRM_Utils_Array::value('loc_block_id', $eventValues)) + $params,
$fieldsFix
);
CRM_Price_BAO_PriceSet::copyPriceSet('civicrm_event', $id, $copyEvent->id);