Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
service.php
1
<?php
2
3
namespace
Bitrix\Seo\BusinessSuite
;
4
5
6
use
Bitrix\Seo\Retargeting
;
7
use
Bitrix\Seo\BusinessSuite\AuthAdapter\Facebook\BusinessAuthAdapter
;
8
9
class
Service
implements
Retargeting\IService
,
IInternalService
10
{
11
public
const
GROUP
=
'business'
;
12
public
const
FACEBOOK_TYPE
=
"facebook"
;
13
public
const
INSTAGRAM_TYPE
=
'instagram'
;
14
16
private
static
$authAdapterPool = [];
17
18
private
function
__construct()
19
{}
20
21
private
function
__clone()
22
{}
23
27
public
static
function
getMethodPrefix
() : string
28
{
29
return
'business'
;
30
}
31
37
public
function
getConfig
(
string
$type):
Config
38
{
39
return
Config::create
($type)->setService($this);
40
}
41
47
public
function
getExtension
(
string
$type) :
Extension
48
{
49
return
Extension::create($type)->
setService
($this);
50
}
51
57
public
function
getConversion
(
string
$type) :
Conversion
58
{
59
return
Conversion::create
($type)->
setService
($this);
60
}
61
67
public
function
getAccount
(
string
$type) :
Account
68
{
69
return
Account::create($type)->
setService
($this);
70
}
71
75
public
static
function
getInstance
(): self
76
{
77
static
$instance;
78
if
(!$instance)
79
{
80
$instance =
new
self
();
81
}
82
83
return
$instance;
84
}
85
91
public
static
function
getEngineCode
($type): string
92
{
93
return
self::GROUP.
'.'
.$type;
94
}
95
99
public
static
function
getTypes
(): array
100
{
101
return
[self::FACEBOOK_TYPE, self::INSTAGRAM_TYPE];
102
}
103
110
public
static
function
getAuthAdapter
($type) :
BusinessAuthAdapter
111
{
112
if
(!array_key_exists($type,static::$authAdapterPool))
113
{
114
static::$authAdapterPool[$type] = BusinessAuthAdapter::create($type)->
setService
(static::getInstance());
115
}
116
117
return
static::$authAdapterPool[$type];
118
}
119
123
public
static
function
getTypeByEngine
(
string
$engineCode): ?string
124
{
125
foreach
(static::getTypes() as $type)
126
{
127
if
($engineCode == static::getEngineCode($type))
128
{
129
130
return
$type;
131
}
132
}
133
134
return
null
;
135
}
136
140
public
static
function
canUseAsInternal
(): bool
141
{
142
return
true
;
143
}
144
}
Bitrix\Main\Search\MapBuilder\create
static create()
Definition
mapbuilder.php:25
Bitrix\Seo\BusinessSuite\Account
Definition
account.php:8
Bitrix\Seo\BusinessSuite\AuthAdapter\Facebook\BusinessAuthAdapter
Definition
businessauthadapter.php:15
Bitrix\Seo\BusinessSuite\Conversion
Definition
conversion.php:12
Bitrix\Seo\BusinessSuite\Extension
Definition
extension.php:9
Bitrix\Seo\BusinessSuite\Service
Definition
service.php:10
Bitrix\Seo\BusinessSuite\Service\getTypes
static getTypes()
Definition
service.php:99
Bitrix\Seo\BusinessSuite\Service\getEngineCode
static getEngineCode($type)
Definition
service.php:91
Bitrix\Seo\BusinessSuite\Service\getConfig
getConfig(string $type)
Definition
service.php:37
Bitrix\Seo\BusinessSuite\Service\INSTAGRAM_TYPE
const INSTAGRAM_TYPE
Definition
service.php:13
Bitrix\Seo\BusinessSuite\Service\FACEBOOK_TYPE
const FACEBOOK_TYPE
Definition
service.php:12
Bitrix\Seo\BusinessSuite\Service\getTypeByEngine
static getTypeByEngine(string $engineCode)
Definition
service.php:123
Bitrix\Seo\BusinessSuite\Service\getMethodPrefix
static getMethodPrefix()
Definition
service.php:27
Bitrix\Seo\BusinessSuite\Service\canUseAsInternal
static canUseAsInternal()
Definition
service.php:140
Bitrix\Seo\BusinessSuite\Service\getAccount
getAccount(string $type)
Definition
service.php:67
Bitrix\Seo\BusinessSuite\Service\getInstance
static getInstance()
Definition
service.php:75
Bitrix\Seo\BusinessSuite\Service\GROUP
const GROUP
Definition
service.php:11
Bitrix\Seo\BusinessSuite\Service\getAuthAdapter
static getAuthAdapter($type)
Definition
service.php:110
Bitrix\Seo\BusinessSuite\Service\getConversion
getConversion(string $type)
Definition
service.php:57
Bitrix\Seo\BusinessSuite\Service\getExtension
getExtension(string $type)
Definition
service.php:47
Bitrix\Seo\Retargeting\AuthAdapter\setService
setService(IService $service)
Definition
authadapter.php:62
Bitrix\Seo\Retargeting\BaseApiObject\setService
setService(IService $service)
Definition
baseapiobject.php:72
Bitrix\Seo\BusinessSuite\IInternalService
Definition
iinternalservice.php:8
Bitrix\Seo\Retargeting\IService
Definition
iservice.php:6
Bitrix\Main\Config
Definition
configuration.php:2
Bitrix\Seo\BusinessSuite
Definition
abstractbase.php:3
Bitrix\Seo\Retargeting
Definition
account.php:3
modules
seo
lib
businesssuite
service.php
Создано системой
1.10.0