1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
factory.php
См. документацию.
1<?php
2
3namespace Bitrix\Calendar\Sync\Office365;
4
5use Bitrix\Calendar\Core\Base\BaseException;
6use Bitrix\Calendar\Sync\Connection\Connection;
7use Bitrix\Calendar\Sync\Factories\FactoryBase;
8use Bitrix\Calendar\Sync\Managers\EventManagerInterface;
9use Bitrix\Calendar\Sync\Managers\IncomingEventManagerInterface;
10use Bitrix\Calendar\Sync\Managers\IncomingSectionManagerInterface;
11use Bitrix\Calendar\Sync\Managers\OutgoingEventManagerInterface;
12use Bitrix\Calendar\Sync\Managers\OutgoingSectionManagerInterface;
13use Bitrix\Calendar\Sync\Managers\PushManagerInterface;
14use Bitrix\Calendar\Sync\Managers\SectionManagerInterface;
15use Bitrix\Calendar\Sync;
16use Bitrix\Calendar\Sync\Util\Context;
17use Bitrix\Main\ObjectNotFoundException;
18use Bitrix\Main\SystemException;
19use Psr\Container\NotFoundExceptionInterface;
20
21class Factory extends FactoryBase
22{
24
26 private Office365Context $officeContext;
27
28 public const SERVICE_NAME = 'office365';
29
31 private EventManagerInterface $eventManager;
33 private SectionManagerInterface $sectionManager;
34
44 {
45 parent::__construct($connection, $context);
47 }
48
50 {
51 if (empty($this->eventManager))
52 {
53 $this->eventManager = new EventManager($this->officeContext);
54 }
55
57 }
58
60 {
61 if (empty($this->sectionManager))
62 {
63 $this->sectionManager = new SectionManager($this->officeContext);
64 }
65
66 return $this->sectionManager;
67 }
68
69 public function getConnection(): Connection
70 {
71 return $this->connection;
72 }
73
74 public function getCode(): string
75 {
76 return $this->getConnection()->getVendor()->getCode();
77 }
78
79 public function canSubscribeSection(): bool
80 {
81 return true;
82 }
83
84 public function getContext(): Sync\Util\Context
85 {
86 return $this->context;
87 }
88
90 {
91 return $this->officeContext->getPushManager();
92 }
93
98 {
99 return $this->officeContext->getIncomingManager();
100 }
101
103 {
104 return $this->officeContext->getIncomingManager();
105 }
106
108 {
109 return $this->officeContext->getOutgoingEventManager();
110 }
111
118 {
119 throw new SystemException("Method " . __METHOD__ . " is not implemented");
120 // TODO: Implement getOutgoingSectionManager() method.
121 }
122}
__construct(Connection $connection, Sync\Util\Context $context=null)
Определения factory.php:43
Sync Util Context $context
Определения factory.php:23
static getConnectionContext(Connection $connection)
Определения office365context.php:62
Определения culture.php:9
$eventManager
Определения include.php:412