Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
factory.php
1<?php
2
4
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
43 public function __construct(Connection $connection, Sync\Util\Context $context = null)
44 {
45 parent::__construct($connection, $context);
47 }
48
50 {
51 if (empty($this->eventManager))
52 {
53 $this->eventManager = new EventManager($this->officeContext);
54 }
55
56 return $this->eventManager;
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)
Definition factory.php:43
static getConnectionContext(Connection $connection)