Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
toloka.php
1<?php
10
14
15Loc::loadMessages(__FILE__);
16
17class 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}
static loadMessages($file)
Definition loc.php:64
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29
saveData($id, array $data)
Definition toloka.php:59