- Модуль: calendar
- Путь к файлу: ~/bitrix/modules/calendar/lib/core/mappers/sectionconnection.php
- Класс: BitrixCalendarCoreMappersSectionConnection
- Вызов: SectionConnection::convertToArray
public function convertToArray(SyncConnectionSectionConnection $sectionConnection): array
{
if (!$sectionConnection->getConnection())
{
throw new BaseException('The sectionConnection must have an connection');
}
return [
'SECTION_ID' => $sectionConnection->getSection()->getId(),
'CONNECTION_ID' => $sectionConnection->getConnection()->getId(),
'VENDOR_SECTION_ID' => $sectionConnection->getVendorSectionId(),
'SYNC_TOKEN' => $sectionConnection->getSyncToken(),
'PAGE_TOKEN' => $sectionConnection->getPageToken(),
'ACTIVE' => $sectionConnection->isActive() ? self::POSITIVE_ANSWER : self::NEGATIVE_ANSWER,
'LAST_SYNC_DATE' => $sectionConnection->getLastSyncDate()
? $sectionConnection->getLastSyncDate()->getDate()
: null,
'LAST_SYNC_STATUS' => $sectionConnection->getLastSyncStatus(),
'VERSION_ID' => $sectionConnection->getVersionId(),
'IS_PRIMARY' => $sectionConnection->isPrimary() ? self::POSITIVE_ANSWER : self::NEGATIVE_ANSWER,
];
}