Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
toloka.php
1
<?php
9
namespace
Bitrix\Sender\Entity
;
10
11
use
Bitrix\Main\Localization\Loc
;
12
use
Bitrix\Sender\Integration
;
13
use
Bitrix\Sender\Message\Factory
;
14
15
Loc::loadMessages
(__FILE__);
16
17
class
Toloka
extends
Letter
18
{
24
protected
static
function
getFilterFields
()
25
{
26
$messageCodes = [];
27
$messages = Factory::getTolokaMessages();
28
foreach
($messages as
$message
)
29
{
30
$messageCodes[] =
$message
->getCode();
31
}
32
33
return
[
34
[
35
'CODE'
=>
null
,
36
'VALUE'
=>
'N'
,
37
'FILTER'
=>
'=CAMPAIGN.IS_TRIGGER'
,
38
],
39
[
40
'CODE'
=>
'IS_ADS'
,
41
'VALUE'
=>
'N'
,
42
'FILTER'
=>
'=IS_ADS'
,
43
],
44
[
45
'CODE'
=>
'MESSAGE_CODE'
,
46
'VALUE'
=> $messageCodes,
47
'FILTER'
=>
'=MESSAGE_CODE'
,
48
],
49
];
50
}
51
59
protected
function
saveData
($id, array $data)
60
{
61
if
(!Integration\Seo\Ads\Service::isAvailable() && Integration\Bitrix24\Service::isTolokaAvailable())
62
{
63
$this->addError(
Loc::getMessage
(
'SENDER_ENTITY_TOLOKA_ERROR_NO_ACCESS'
),
'feature:sender_toloka'
);
64
return
$id;
65
}
66
67
return
parent::saveData($id, $data);
68
}
69
}
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\loadMessages
static loadMessages($file)
Definition
loc.php:64
Bitrix\Main\Localization\Loc\getMessage
static getMessage($code, $replace=null, $language=null)
Definition
loc.php:29
Bitrix\Sender\Entity\Letter
Definition
letter.php:34
Bitrix\Sender\Entity\Letter\$message
$message
Definition
letter.php:39
Bitrix\Sender\Entity\Toloka
Definition
toloka.php:18
Bitrix\Sender\Entity\Toloka\getFilterFields
static getFilterFields()
Definition
toloka.php:24
Bitrix\Sender\Entity\Toloka\saveData
saveData($id, array $data)
Definition
toloka.php:59
Bitrix\Sender\Message\Factory
Definition
factory.php:21
Bitrix\Sender\Entity
Definition
ad.php:8
Bitrix\Sender\Integration
modules
sender
lib
entity
toloka.php
Создано системой
1.10.0