12use Bitrix\Calendar\Sync\Internals\HasContextTrait;
41 $this->context = $context;
59 $result = $this->apiService->getCalendarList($params);
60 return array_map(
function ($row){
79 $result = $this->apiService->getEventList($params);
81 return array_map(
function ($row){
100 $result = $this->apiService->getEvent($params);
102 return array_map(
function ($row){
121 $newSection = $this->apiService->createSection($sectionDto);
140 $newSection = $this->apiService->updateSection($sectionDto);
160 if ($newEvent = $this->apiService->createEvent($dto, $sectionId))
182 foreach ($this->apiService->getCalendarDelta($sectionLink) as $batch)
185 foreach ($batch as $item) {
186 if (!empty($item[
'@removed']))
192 $events[$item[
'id']][$item[
'type']] =
new EventDto($item);
196 $events[$item[
'id']][$item[
'type']] =
new EventDto($item);
208 foreach ($events as $id => $eventDelta)
210 yield $id => $eventDelta;
230 if ($event = $this->apiService->updateEvent($eventDto, $vendorEventId))
252 $result = $this->apiService->getEventInstances($params);
254 if (!empty($result[
'value']))
256 return array_map(
function ($row){
258 }, $result[
'value']) ?? [];
278 $this->apiService->deleteEvent($vendorEventId);
295 $this->apiService->deleteSection($dto->id);
312 $channelId = $this->getChannelId($link);
313 $result = $this->apiService->addSectionSubscription(
320 $result[
'channelId'] = $channelId;
340 return $this->apiService->renewSectionSubscription($subscribeId);
356 return $this->apiService->deleteSectionSubscription($subscribeId);
365 return 'BX_OFFICE_SC_' . $link->
getConnection()->getOwner()->getId() .
'_' . md5($link->
getId() . time());
updateEvent(string $vendorEventId, EventDto $eventDto)
getCalendarDelta(SectionConnection $sectionLink)
getSections(array $params=[])
createSection(SectionDto $sectionDto)
deleteEvent(string $vendorEventId)
updateSection(SectionDto $sectionDto)
__construct(Office365Context $context)
createEvent(EventDto $dto, string $sectionId)
subscribeSection(SectionConnection $link)
resubscribe(string $subscribeId)
unsubscribe(string $subscribeId)
deleteSection(SectionDto $dto)
getEventInstances(array $params)