Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
ad.php
1<?php
9
10
12
15
16Loc::loadMessages(__FILE__);
17
18class Ad extends Letter
19{
25 protected static function getFilterFields()
26 {
27 return array(
28 array(
29 'CODE' => null,
30 'VALUE' => 'N',
31 'FILTER' => '=CAMPAIGN.IS_TRIGGER'
32 ),
33 array(
34 'CODE' => 'IS_ADS',
35 'VALUE' => 'Y',
36 'FILTER' => '=IS_ADS'
37 ),
38 );
39 }
40
48 protected function saveData($id, array $data)
49 {
50 $isAvailable = Integration\Seo\Ads\Service::isAvailable();
51 $code = null;
52 if ($isAvailable)
53 {
54 if ($this instanceof iMarketing)
55 {
56 $isAvailable = Integration\Bitrix24\Service::isFbAdAvailable();
57 $code = 'feature:sender_fb_ads';
58 }
59 elseif ($isAvailable)
60 {
61 $isAvailable = Integration\Bitrix24\Service::isAdAvailable();
62 $code = 'feature:sender_ad';
63 }
64 }
65
66 if (!$isAvailable)
67 {
68 $this->addError(Loc::getMessage('SENDER_ENTITY_AD_ERROR_NO_ACCESS'), $code);
69 return $id;
70 }
71
72 return parent::saveData($id, $data);
73 }
74}
static loadMessages($file)
Definition loc.php:64
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29
static getFilterFields()
Definition ad.php:25
saveData($id, array $data)
Definition ad.php:48