Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
ad.php
1
<?php
8
namespace
Bitrix\Sender\Entity
;
9
10
11
use
Bitrix\Main\Localization\Loc
;
12
13
use
Bitrix\Sender\Integration
;
14
use
Bitrix\Sender\Message\iMarketing
;
15
16
Loc::loadMessages
(__FILE__);
17
18
class
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
}
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\Ad
Definition
ad.php:19
Bitrix\Sender\Entity\Ad\getFilterFields
static getFilterFields()
Definition
ad.php:25
Bitrix\Sender\Entity\Ad\saveData
saveData($id, array $data)
Definition
ad.php:48
Bitrix\Sender\Entity\Letter
Definition
letter.php:34
Bitrix\Sender\Message\iMarketing
Definition
imarketing.php:16
Bitrix\Sender\Entity
Definition
ad.php:8
Bitrix\Sender\Integration
modules
sender
lib
entity
ad.php
Создано системой
1.10.0