3namespace Bitrix\Calendar\Core\Mappers;
5use Bitrix\Calendar\Core;
6use Bitrix\Calendar\Core\Base\BaseException;
7use Bitrix\Calendar\Internals\EO_SectionConnection;
8use Bitrix\Calendar\Internals\SectionConnectionTable;
9use Bitrix\Calendar\Sync;
10use Bitrix\Main\ArgumentException;
11use Bitrix\Main\Loader;
12use Bitrix\Main\LoaderException;
13use Bitrix\Main\ObjectException;
14use Bitrix\Main\ObjectPropertyException;
15use Bitrix\Main\ORM\Query\Result;
16use Bitrix\Main\SystemException;
37 $sectionConnectionFields = $this->
convertToArray($sectionConnection);
39 $result = SectionConnectionTable::update(
40 $sectionConnection->getId(),
41 array_intersect_key($sectionConnectionFields, array_flip(
$fields))
46 return $sectionConnection;
50 . implode(
'; ',
$result->getErrorMessages()),
62 if (!$sectionConnection->getConnection())
64 throw new BaseException(
'The sectionConnection must have an connection');
68 'SECTION_ID' => $sectionConnection->getSection()->getId(),
69 'CONNECTION_ID' => $sectionConnection->getConnection()->getId(),
70 'VENDOR_SECTION_ID' => $sectionConnection->getVendorSectionId(),
71 'SYNC_TOKEN' => $sectionConnection->getSyncToken(),
72 'PAGE_TOKEN' => $sectionConnection->getPageToken(),
73 'ACTIVE' => $sectionConnection->isActive() ? self::POSITIVE_ANSWER : self::NEGATIVE_ANSWER,
74 'LAST_SYNC_DATE' => $sectionConnection->getLastSyncDate()
75 ? $sectionConnection->getLastSyncDate()->getDate()
77 'LAST_SYNC_STATUS' => $sectionConnection->getLastSyncStatus(),
78 'VERSION_ID' => $sectionConnection->getVersionId(),
79 'IS_PRIMARY' => $sectionConnection->isPrimary() ? self::POSITIVE_ANSWER : self::NEGATIVE_ANSWER,
88 return Sync\Connection\SectionConnectionMap::class;
96 return 'section connection link';
110 if (!Loader::includeModule(
'dav'))
115 $link = SectionConnectionTable::query()
121 'SERVER_PASSWORD' =>
'CONNECTION.SERVER_PASSWORD',
122 'SERVER_USERNAME' =>
'CONNECTION.SERVER_USERNAME'
124 ->exec()->fetchObject();
143 $section = $objectEO->getSection();
144 if ($section !==
null)
169 ->setId($objectEO->getId())
170 ->setSection($section)
172 ->setVendorSectionId($objectEO->getVendorSectionId())
173 ->setSyncToken($objectEO->getSyncToken())
174 ->setPageToken($objectEO->getPageToken())
175 ->setActive($objectEO->getActive())
176 ->setLastSyncDate(
new Core\
Base\
Date($objectEO->getLastSyncDate()))
177 ->setLastSyncStatus($objectEO->getLastSyncStatus())
178 ->setVersionId($objectEO->get(
'VERSION_ID'))
179 ->setPrimary($objectEO->getIsPrimary())
205 throw new BaseException(
'Error of create SectionConnection: '
206 . implode(
'; ',
$result->getErrorMessages()),
230 throw new BaseException(
'Error of update SectionConnection: '
231 . implode(
'; ',
$result->getErrorMessages()),
249 if (!empty(
$params[
'softDelete']))
262 throw new BaseException(
'Error of delete SectionConnection: '
263 . implode(
'; ',
$result->getErrorMessages()),
279 Loader::includeModule(
'dav');
280 if (
$params[
'select'] === self::DEFAULT_SELECT)
286 'SERVER_PASSWORD' =>
'CONNECTION.SERVER_PASSWORD',
287 'SERVER_USERNAME' =>
'CONNECTION.SERVER_USERNAME'
291 return SectionConnectionTable::getList(
$params);
299 return Sync\Connection\SectionConnection::class;
prepareSection(EO_Section $sectionEO)
prepareConnection(EO_DavConnection $connectionEO)
getOneEntityByFilter(array $filter)
convertToObject($objectEO)
updateEntity($entity, array $params=[])
convertToArray(Sync\Connection\SectionConnection $sectionConnection)
deleteEntity(Core\Base\EntityInterface $entity, array $params=['softDelete'=> true])
createEntity($entity, array $params=[])
getDataManagerResult(array $params)
patch(Sync\Connection\SectionConnection $sectionConnection, array $fields)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']