Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
ConnectorLine.php
1
<?php
2
3
namespace
Bitrix\MessageService\Providers\Edna\WhatsApp
;
4
5
use Bitrix\ImConnector\Library;
6
use
Bitrix\Main\Loader
;
7
use
Bitrix\Main\Result
;
8
use
Bitrix\MessageService\Providers\Edna\Constants\ChannelType
;
9
10
class
ConnectorLine
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
}
Bitrix\Bizproc\Result
Definition
result.php:6
Bitrix\Main\Loader
Definition
loader.php:12
Bitrix\Main\ORM\Data\Result
Definition
result.php:16
Bitrix\MessageService\Providers\Edna\Constants\ChannelType
Definition
ChannelType.php:6
Bitrix\MessageService\Providers\Edna\Constants\ChannelType\WHATSAPP
const WHATSAPP
Definition
ChannelType.php:7
Bitrix\MessageService\Providers\Edna\WhatsApp\ConnectorLine
Definition
ConnectorLine.php:11
Bitrix\MessageService\Providers\Edna\WhatsApp\ConnectorLine\testConnection
testConnection()
Definition
ConnectorLine.php:38
Bitrix\MessageService\Providers\Edna\WhatsApp\ConnectorLine\getLineId
getLineId()
Definition
ConnectorLine.php:19
Bitrix\MessageService\Providers\Edna\WhatsApp\ConnectorLine\__construct
__construct(\Bitrix\MessageService\Providers\Edna\EdnaRu $utils)
Definition
ConnectorLine.php:14
Bitrix\MessageService\Providers\Edna\WhatsApp\ConnectorLine\$utils
Bitrix MessageService Providers Edna EdnaRu $utils
Definition
ConnectorLine.php:12
Bitrix\MessageService\Providers\Edna\EdnaRu
Definition
EdnaRu.php:8
Bitrix\MessageService\Providers\Edna\WhatsApp
Definition
ConnectorLine.php:3
Bitrix
modules
messageservice
lib
Providers
Edna
WhatsApp
ConnectorLine.php
Создано системой
1.10.0