+
+ if (CRM_Core_BAO_RecurringEntity::MODE_NEXT_ALL_ENTITY === $mode) {
+ //Step-1: Get all events of series
+ $seriesEventRecords = CRM_Core_BAO_RecurringEntity::getEntitiesFor($entityId, $entityTable);
+ foreach ($seriesEventRecords as $event) {
+ //Step-2: Save price set in other series events
+ if ($entityId < $event["id"]) {
+ if (CRM_Price_BAO_PriceSet::removeFrom($event['table'], $event['id'])) {//Remove existing priceset
+ CRM_Core_BAO_Discount::del($event['id'], $event['table']);
+ }
+ CRM_Price_BAO_PriceSet::addTo($event['table'], $event['id'], $priceSet); //Add new price set
+ }
+ }
+ }