Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
service.php
1
<?
2
3
namespace
Bitrix\Seo\Retargeting
;
4
5
use
Bitrix\Main\Config\Option
;
6
use
Bitrix\Seo\BusinessSuite\IInternalService
;
7
8
class
Service
implements
IService
,
IMultiClientService
,
IInternalService
9
{
10
const
GROUP
=
'retargeting'
;
11
12
const
TYPE_FACEBOOK
=
'facebook'
;
13
const
TYPE_VKONTAKTE
=
'vkontakte'
;
14
const
TYPE_MYCOM
=
'mycom'
;
15
const
TYPE_YANDEX
=
'yandex'
;
16
const
TYPE_GOOGLE
=
'google'
;
17
18
protected
$clientId
;
19
25
public
static
function
getInstance
():
Service
26
{
27
static
$instance =
null
;
28
if
($instance ===
null
)
29
{
30
$instance =
new
static
();
31
}
32
33
return
$instance;
34
}
35
40
public
static
function
getEngineCode
($type)
41
{
42
return
static::GROUP .
'.'
. $type;
43
}
44
49
public
static
function
getAudience
($type)
50
{
51
return
Audience::create($type)->setService(static::getInstance());
52
}
53
58
public
static
function
getAccount
($type)
59
{
60
return
Account::create($type)->setService(static::getInstance());
61
}
62
69
public
static
function
canUseMultipleClients
()
70
{
71
return
Option::get(
'seo'
,
'use_multiple_clients'
,
true
);
72
}
73
77
public
static
function
getTypes
()
78
{
79
return
array(
80
static::TYPE_FACEBOOK,
81
static::TYPE_VKONTAKTE,
82
static::TYPE_GOOGLE,
83
static::TYPE_YANDEX
84
);
85
}
86
93
public
static
function
getAuthAdapter
($type)
94
{
95
return
AuthAdapter::create($type)->setService(static::getInstance());
96
}
101
public
function
getClientId
()
102
{
103
return
$this->clientId;
104
}
110
public
function
setClientId
($clientId)
111
{
112
$this->clientId =
$clientId
;
113
}
114
118
public
static
function
getTypeByEngine
(
string
$engineCode): ?string
119
{
120
foreach
(static::getTypes() as $type)
121
{
122
if
($engineCode === static::getEngineCode($type))
123
{
124
return
$type;
125
}
126
}
127
return
null
;
128
}
132
public
static
function
canUseAsInternal
(): bool
133
{
134
return
true
;
135
}
136
140
public
static
function
getMethodPrefix
(): string
141
{
142
return
'retargeting'
;
143
}
144
}
Bitrix\Main\Config\Option
Definition
option.php:15
Bitrix\Seo\Retargeting\Service
Definition
service.php:9
Bitrix\Seo\Retargeting\Service\TYPE_VKONTAKTE
const TYPE_VKONTAKTE
Definition
service.php:13
Bitrix\Seo\Retargeting\Service\getAccount
static getAccount($type)
Definition
service.php:58
Bitrix\Seo\Retargeting\Service\TYPE_YANDEX
const TYPE_YANDEX
Definition
service.php:15
Bitrix\Seo\Retargeting\Service\getTypes
static getTypes()
Definition
service.php:77
Bitrix\Seo\Retargeting\Service\getEngineCode
static getEngineCode($type)
Definition
service.php:40
Bitrix\Seo\Retargeting\Service\getTypeByEngine
static getTypeByEngine(string $engineCode)
Definition
service.php:118
Bitrix\Seo\Retargeting\Service\$clientId
$clientId
Definition
service.php:18
Bitrix\Seo\Retargeting\Service\TYPE_MYCOM
const TYPE_MYCOM
Definition
service.php:14
Bitrix\Seo\Retargeting\Service\getMethodPrefix
static getMethodPrefix()
Definition
service.php:140
Bitrix\Seo\Retargeting\Service\canUseAsInternal
static canUseAsInternal()
Definition
service.php:132
Bitrix\Seo\Retargeting\Service\setClientId
setClientId($clientId)
Definition
service.php:110
Bitrix\Seo\Retargeting\Service\TYPE_GOOGLE
const TYPE_GOOGLE
Definition
service.php:16
Bitrix\Seo\Retargeting\Service\getClientId
getClientId()
Definition
service.php:101
Bitrix\Seo\Retargeting\Service\getAudience
static getAudience($type)
Definition
service.php:49
Bitrix\Seo\Retargeting\Service\getInstance
static getInstance()
Definition
service.php:25
Bitrix\Seo\Retargeting\Service\GROUP
const GROUP
Definition
service.php:10
Bitrix\Seo\Retargeting\Service\getAuthAdapter
static getAuthAdapter($type)
Definition
service.php:93
Bitrix\Seo\Retargeting\Service\TYPE_FACEBOOK
const TYPE_FACEBOOK
Definition
service.php:12
Bitrix\Seo\Retargeting\Service\canUseMultipleClients
static canUseMultipleClients()
Definition
service.php:69
Bitrix\Seo\BusinessSuite\IInternalService
Definition
iinternalservice.php:8
Bitrix\Seo\Retargeting\IMultiClientService
Definition
imulticlientservice.php:6
Bitrix\Seo\Retargeting\IService
Definition
iservice.php:6
Bitrix\Seo\Retargeting
Definition
account.php:3
modules
seo
lib
retargeting
service.php
Создано системой
1.10.0