Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
ConnectorLine.php
1<?php
2
4
5use Bitrix\ImConnector\Library;
9
11{
12 protected \Bitrix\MessageService\Providers\Edna\EdnaRu $utils;
13
14 public function __construct(\Bitrix\MessageService\Providers\Edna\EdnaRu $utils)
15 {
16 $this->utils = $utils;
17 }
18
19 public function getLineId(): ?int
20 {
21 if (!Loader::includeModule('imconnector'))
22 {
23 return null;
24 }
25
26 $statuses = \Bitrix\ImConnector\Status::getInstanceAllLine(Library::ID_EDNA_WHATSAPP_CONNECTOR);
27 foreach ($statuses as $status)
28 {
29 if ($status->isConfigured())
30 {
31 return (int)$status->getLine();
32 }
33 }
34
35 return null;
36 }
37
38 public function testConnection(): Result
39 {
40 return $this->utils->getChannelList(ChannelType::WHATSAPP);
41 }
42
43}
__construct(\Bitrix\MessageService\Providers\Edna\EdnaRu $utils)
Bitrix MessageService Providers Edna EdnaRu $utils