Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
importsectionmanager.php
1<?php
2
4
5use Bitrix\Calendar\Core;
10use Exception;
11
13{
14 private ?Sync\Entities\SyncSectionMap $externalSyncSectionMap = null;
15 private IncomingSectionManagerInterface $importManager;
16
23 public function __construct(FactoryBase $factory)
24 {
25 $this->importManager = $factory->getIncomingSectionManager();
26 }
27
35 public function import(): ImportSectionManager
36 {
37 $result = $this->importManager->getSections();
38 if ($result->isSuccess())
39 {
40 $this->externalSyncSectionMap = $result->getData()['externalSyncSectionMap'];
41 }
42
43 return $this;
44 }
45
49 public function getSyncSectionMap(): ?Sync\Entities\SyncSectionMap
50 {
51 return $this->externalSyncSectionMap ?? new Sync\Entities\SyncSectionMap();
52 }
53
54 public function getSyncToken(): ?string
55 {
56 return $this->importManager->getSyncToken();
57 }
58
59 public function getEtag(): ?string
60 {
61 return $this->importManager->getEtag();
62 }
63
64 public function getStatus(): ?string
65 {
66 return $this->importManager->getStatus();
67 }
68}