Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
Registrar.php
1
<?php
2
3
namespace
Bitrix\MessageService\Providers\Edna\SMS\Old
;
4
5
use
Bitrix\Main\Result
;
6
use
Bitrix\MessageService\Providers\Constants\InternalOption
;
7
use
Bitrix\MessageService\Providers\Edna\SMS\ExternalSender
;
8
9
class
Registrar
extends
\Bitrix\MessageService\Providers\Edna\SMS\Registrar
10
{
11
public
function
register
(array $fields):
Result
12
{
13
$this->optionManager->setOption(InternalOption::API_KEY, $fields[InternalOption::API_KEY]);
14
$externalSender =
new
ExternalSender
($fields[InternalOption::API_KEY],
Constants::API_ENDPOINT
);
15
16
return
$externalSender->callExternalMethod(
'smsSubject/'
);
17
}
18
22
public
function
getOwnerInfo
(): array
23
{
24
$initiator =
new
Initiator
($this->optionManager,$this, $this->utils);
25
26
return
[
27
InternalOption::API_KEY => $this->optionManager->getOption(InternalOption::API_KEY),
28
InternalOption::SENDER_ID => array_column($initiator->getFromList(),
'name'
),
29
];
30
}
31
32
public
function
getExternalManageUrl
(): string
33
{
34
return
'https://sms.edna.ru/'
;
35
}
36
37
public
function
isRegistered
(): bool
38
{
39
return
$this->optionManager->getOption(InternalOption::API_KEY,
''
) !==
''
;
40
}
41
42
}
Bitrix\Main\ORM\Data\Result
Definition
result.php:16
Bitrix\Main\Result
Definition
result.php:14
Bitrix\MessageService\Providers\Constants\InternalOption
Definition
InternalOption.php:6
Bitrix\MessageService\Providers\Edna\SMS\ExternalSender
Definition
ExternalSender.php:16
Bitrix\MessageService\Providers\Edna\SMS\Old\Constants\API_ENDPOINT
const API_ENDPOINT
Definition
Constants.php:7
Bitrix\MessageService\Providers\Edna\SMS\Old\Initiator
Definition
Initiator.php:9
Bitrix\MessageService\Providers\Edna\SMS\Old\Registrar
Definition
Registrar.php:10
Bitrix\MessageService\Providers\Edna\SMS\Old\Registrar\isRegistered
isRegistered()
Definition
Registrar.php:37
Bitrix\MessageService\Providers\Edna\SMS\Old\Registrar\getExternalManageUrl
getExternalManageUrl()
Definition
Registrar.php:32
Bitrix\MessageService\Providers\Edna\SMS\Old\Registrar\getOwnerInfo
getOwnerInfo()
Definition
Registrar.php:22
Bitrix\MessageService\Providers\Edna\SMS\Registrar
Definition
Registrar.php:12
Bitrix\MessageService\Providers\Edna\SMS\Old
Definition
Constants.php:3
modules
messageservice
lib
Providers
Edna
SMS
Old
Registrar.php
Создано системой
1.10.0