Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
Sender.php
1
<?php
2
3
namespace
Bitrix\MessageService\Controller
;
4
5
use
Bitrix\Main\Error
;
6
use
Bitrix\Main\Localization\Loc
;
7
8
class
Sender
extends
\Bitrix\Main\Engine\Controller
9
{
10
public
function
getTemplatesAction
(
string
$id, array $context =
null
): ?array
11
{
12
$sender = \Bitrix\MessageService\Sender\SmsManager::getSenderById($id);
13
if
(!$sender)
14
{
15
$this->errorCollection->setError(
new
Error
(
Loc::getMessage
(
'SENDER_TEMPLATES_WRONG_SENDER'
)));
16
17
return
null
;
18
}
19
20
if
(!$sender->canUse() || !$sender->isConfigurable() || !$sender->isTemplatesBased())
21
{
22
$this->errorCollection->setError(
new
Error
(
Loc::getMessage
(
'SENDER_TEMPLATES_CAN_NOT_USE'
)));
23
24
return
null
;
25
}
26
27
return
[
28
'templates'
=> $sender->getTemplatesList($context)
29
];
30
}
31
}
Bitrix\Main\Engine\Controller
Definition
controller.php:32
Bitrix\Main\Error
Definition
error.php:14
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\MessageService\Controller\Sender
Definition
Sender.php:9
Bitrix\MessageService\Controller\Sender\getTemplatesAction
getTemplatesAction(string $id, array $context=null)
Definition
Sender.php:10
Bitrix\MessageService\Controller
Definition
Sender.php:3
modules
messageservice
lib
Controller
Sender.php
Создано системой
1.10.0