• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/lib/sync/office365/incomingmanager.php
  • Класс: BitrixCalendarSyncOffice365IncomingManager
  • Вызов: IncomingManager::prepareSyncSection
private function prepareSyncSection(SectionDto $sectionDto): SyncSection
{
	$section = $this->context->getConverter()->convertSection($sectionDto);
	$section
		->setExternalType(Helper::ACCOUNT_TYPE)
		->setOwner($this->connection->getOwner())
		->setCreator($this->connection->getOwner())
		->setIsActive(true)
		->setType('user')
	;
	$sectionConnection = (new SectionConnection())
		->setSection($section)
		->setConnection($this->connection)
		->setVendorSectionId($sectionDto->id)
		->setActive(true)
		->setLastSyncDate(null)
		->setPrimary($sectionDto->isDefaultCalendar ?? false)
		->setOwner($this->connection->getOwner())
		->setLastSyncStatus(Dictionary::SYNC_STATUS['success'])
		->setVersionId($sectionDto->changeKey)
	;

	return (new SyncSection())
		->setSection($section)
		->setSectionConnection($sectionConnection)
		->setVendorName($this->getServiceName())
		->setAction(Dictionary::SYNC_STATUS['success'])
		;
}