1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
service.php
См. документацию.
1<?
2
3namespace Bitrix\Seo\Retargeting;
4
5use Bitrix\Main\Config\Option;
6use Bitrix\Seo\BusinessSuite\IInternalService;
7
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 }
97
101 public function getClientId()
102 {
103 return $this->clientId;
104 }
105
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 }
129
132 public static function canUseAsInternal(): bool
133 {
134 return true;
135 }
136
140 public static function getMethodPrefix(): string
141 {
142 return 'retargeting';
143 }
144}
$type
Определения options.php:106
static create($type, IService $service=null, bool $ignoreType=false)
Определения authadapter.php:43
static create($type, $parameters=null, IService $service=null)
Определения baseapiobject.php:61
const TYPE_VKONTAKTE
Определения service.php:13
static getAccount($type)
Определения service.php:58
const TYPE_YANDEX
Определения service.php:15
static getTypes()
Определения service.php:77
static getEngineCode($type)
Определения service.php:40
static getTypeByEngine(string $engineCode)
Определения service.php:118
const TYPE_MYCOM
Определения service.php:14
static getMethodPrefix()
Определения service.php:140
static canUseAsInternal()
Определения service.php:132
setClientId($clientId)
Определения service.php:110
const TYPE_GOOGLE
Определения service.php:16
static getAudience($type)
Определения service.php:49
static getInstance()
Определения service.php:25
const GROUP
Определения service.php:10
static getAuthAdapter($type)
Определения service.php:93
const TYPE_FACEBOOK
Определения service.php:12
static canUseMultipleClients()
Определения service.php:69
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$instance
Определения ps_b24_final.php:14
$clientId
Определения seo_client.php:18