98 return $this->
event->getId();
106 return $this->
event->getParentId();
114 return $this->eventConnection->getEntityTag();
122 return $this->eventConnection->getVendorEventId();
130 return $this->
event->getUid();
138 return $this->
event->isRecurrence();
165 return $this->
event->isInstance();
176 if ($this->instanceMap ===
null)
181 if (!$this->event->getExcludedDateCollection())
183 $this->
event->setExcludedDateCollection(
new Core\
Event\Properties\ExcludedDatesCollection());
186 $instance->
getEvent()->getOriginalDateFrom()
187 ? $this->updateExcludedDatesMasterEvent($instance->
getEvent()->getOriginalDateFrom())
188 : $this->updateExcludedDatesMasterEvent($instance->
getEvent()->getStart())
191 $this->instanceMap->add($instance);
202 public function addInstanceList(array $list):
SyncEvent
204 if ($this->instanceMap ===
null)
210 foreach ($list as $item)
223 return $this->instanceMap !==
null && $this->instanceMap->count();
231 if (!$this->eventConnection)
236 return $this->eventConnection->getRecurrenceId();
244 return $this->action === Sync\Dictionary::SYNC_SECTION_ACTION[
'success'];
252 private function updateExcludedDatesMasterEvent(Core\Base\
Date $excludedDate): void
254 $date = clone $excludedDate;
255 $date->setDateTimeFormat(Core\
Event\Properties\ExcludedDatesCollection::EXCLUDED_DATE_FORMAT);
257 if ($this->event->getExcludedDateCollection())
259 $this->addExcludeDate($date);
263 $this->
event->setExcludedDateCollection(
new Core\
Event\Properties\ExcludedDatesCollection([$date]));
272 return $this->
event->isBaseEvent();
280 return $this->
event->isSingle();
288 private function addExcludeDate(Core\Base\
Date $newExDate)
291 foreach ($this->event->getExcludedDateCollection() as $exDate)
293 if ($exDate->format(
'Ymd') === $newExDate->format(
'Ymd'))
299 $this->
event->getExcludedDateCollection()->add($newExDate);