public function applyToEvent(EventModel $event, EventModel $originalEvent) { $changes = false; if ($this->summary_change_possible && $this->summary_change_selected) { $event->setSummary($this->summary); $changes = true; } if ($this->description_change_possible && $this->description_change_selected) { $event->setDescription($originalEvent->getDescription()); $changes = true; } if ($this->timezone_change_possible && $this->timezone_change_selected) { $event->setTimezone($originalEvent->getTimezone()); $changes = true; } if ($this->country_area_venue_id_change_possible && $this->country_area_venue_id_change_selected) { $event->setCountryId($originalEvent->getCountryId()); $event->setAreaId($originalEvent->getAreaId()); $event->setVenueId($originalEvent->getVenueId()); $changes = true; } if ($this->url_change_possible && $this->url_change_selected) { $event->setUrl($originalEvent->getUrl()); $changes = true; } if ($this->ticket_url_change_possible && $this->ticket_url_change_selected) { $event->setTicketUrl($originalEvent->getTicketUrl()); $changes = true; } if ($this->is_virtual_change_possible && $this->is_virtual_change_selected) { $event->setIsVirtual($originalEvent->getIsVirtual()); $changes = true; } if ($this->is_physical_change_possible && $this->is_physical_change_selected) { $event->setIsPhysical($originalEvent->getIsPhysical()); $changes = true; } if ($this->start_end_at_change_possible && $this->start_end_at_change_selected) { $event->setStartAt($this->start_at); $event->setEndAt($this->end_at); $changes = true; } if ($this->is_cancelled_change_possible && $this->is_cancelled_change_selected) { $event->setIsCancelled($originalEvent->getIsCancelled()); $changes = true; } foreach ($this->custom_fields as $customField) { if ($this->getCustomFieldChangePossible($customField) && $this->getCustomFieldChangeSelected($customField)) { $event->setCustomField($customField, $originalEvent->getCustomField($customField)); $changes = true; } } return $changes; }