function addDataToEventBeforeCheck(EventModel $eventModel)
 {
     $eventModel->setSummary($this->draftEvent->getDetailsValue('event.summary'));
     $eventModel->setDescription($this->draftEvent->getDetailsValue('event.description'));
     $eventModel->setUrl($this->draftEvent->getDetailsValue('event.url'));
     $eventModel->setTicketUrl($this->draftEvent->getDetailsValue('event.ticket_url'));
     foreach ($this->site->getCachedEventCustomFieldDefinitionsAsModels() as $customField) {
         if ($this->draftEvent->hasDetailsValue('event.custom.' . $customField->getKey())) {
             $eventModel->setCustomField($customField, $this->draftEvent->getDetailsValue('event.custom.' . $customField->getKey()));
         }
     }
     if ($this->site->getIsFeaturePhysicalEvents() && $this->site->getIsFeatureVirtualEvents()) {
         $eventModel->setIsPhysical($this->draftEvent->getDetailsValue('event.is_physical'));
         $eventModel->setIsVirtual($this->draftEvent->getDetailsValue('event.is_virtual'));
     } else {
         if ($this->site->getIsFeaturePhysicalEvents()) {
             $eventModel->setIsPhysical(true);
             $eventModel->setIsVirtual(false);
         } else {
             if ($this->site->getIsFeatureVirtualEvents()) {
                 $eventModel->setIsPhysical(false);
                 $eventModel->setIsVirtual(true);
             }
         }
     }
 }
 protected function newEventFromImportedEventModel(ImportedEventModel $importedEvent)
 {
     $event = new EventModel();
     $event->setFromImportedEventModel($importedEvent);
     if ($this->site->getIsFeaturePhysicalEvents() && !$this->site->getIsFeatureVirtualEvents()) {
         $event->setIsPhysical(true);
         $event->setIsVirtual(false);
     } else {
         if (!$this->site->getIsFeaturePhysicalEvents() && $this->site->getIsFeatureVirtualEvents()) {
             $event->setIsPhysical(false);
             $event->setIsVirtual(true);
         }
     }
     if ($this->country) {
         // country is set on importer.
         $event->setCountryId($this->country->getId());
         $timezones = $this->country->getTimezonesAsList();
         if ($importedEvent->getTimezone() && in_array($importedEvent->getTimezone(), $timezones)) {
             $event->setTimezone($importedEvent->getTimezone());
         } else {
             if ($timezones) {
                 // take first timezone in that country at random :-/
                 $event->setTimezone($timezones[0]);
             }
         }
         if ($this->area) {
             $event->setAreaId($this->area->getId());
         }
     } else {
         // if no country set on importer, we just pick first one at random :-/
         $crb = new \repositories\builders\CountryRepositoryBuilder();
         $crb->setSiteIn($this->site);
         $crb->setLimit(1);
         $countries = $crb->fetchAll();
         if (count($countries) > 0) {
             $country = $countries[0];
             $event->setCountryId($country->getId());
             $timezones = $country->getTimezonesAsList();
             if ($importedEvent->getTimezone() && in_array($importedEvent->getTimezone(), $timezones)) {
                 $event->setTimezone($importedEvent->getTimezone());
             } else {
                 if ($timezones) {
                     // take first timezone in that country at random :-/
                     $event->setTimezone($timezones[0]);
                 }
             }
         }
     }
     return $event;
 }