Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
service.php
1
<?php
2
3
namespace
Bitrix\Seo\Catalog
;
4
5
use
Bitrix\Seo\BusinessSuite\IInternalService
;
6
use
Bitrix\Seo\Retargeting\AuthAdapter
;
7
use
Bitrix\Seo\Retargeting\IService
;
8
9
final
class
Service
implements
IService
,
IInternalService
10
{
12
private
static
$authAdapterPool = [];
13
14
public
const
GROUP
=
'catalog'
;
15
16
public
const
TYPE_FACEBOOK
=
'facebook'
;
17
18
19
private
function
__construct()
20
{}
21
22
private
function
__clone()
23
{}
24
28
public
static
function
getInstance
():
Service
29
{
30
static
$instance;
31
return
$instance = $instance ??
new
Service
;
32
}
33
37
public
static
function
getTypeByEngine
(
string
$engineCode): ?string
38
{
39
foreach
(self::getTypes() as $type)
40
{
41
if
($engineCode === self::getEngineCode($type))
42
{
43
return
$type;
44
}
45
}
46
return
null
;
47
}
48
52
public
static
function
canUseAsInternal
(): bool
53
{
54
return
true
;
55
}
56
60
public
static
function
getMethodPrefix
(): string
61
{
62
return
self::GROUP;
63
}
64
68
public
static
function
getEngineCode
($type) : string
69
{
70
return
self::GROUP .
'.'
. $type;
71
}
72
76
public
static
function
getTypes
() : array
77
{
78
return
[ self::TYPE_FACEBOOK ];
79
}
80
85
public
static
function
getAuthAdapter
($type) :
AuthAdapter
86
{
87
if
(!array_key_exists( $type, self::$authAdapterPool ))
88
{
89
return
self::$authAdapterPool[$type] = AuthAdapter::create($type)->
setService
(self::getInstance());
90
}
91
return
self::$authAdapterPool[$type];
92
}
93
99
public
function
getCatalog
(
string
$type):
Catalog
100
{
101
return
Catalog::create
($type)->
setService
($this);
102
}
103
}
Bitrix\Main\IO\DirectoryEntry\create
create()
Definition
directoryentry.php:12
Bitrix\Seo\Catalog\Catalog
Definition
catalog.php:15
Bitrix\Seo\Catalog\Service
Definition
service.php:10
Bitrix\Seo\Catalog\Service\getTypes
static getTypes()
Definition
service.php:76
Bitrix\Seo\Catalog\Service\getEngineCode
static getEngineCode($type)
Definition
service.php:68
Bitrix\Seo\Catalog\Service\getTypeByEngine
static getTypeByEngine(string $engineCode)
Definition
service.php:37
Bitrix\Seo\Catalog\Service\getMethodPrefix
static getMethodPrefix()
Definition
service.php:60
Bitrix\Seo\Catalog\Service\canUseAsInternal
static canUseAsInternal()
Definition
service.php:52
Bitrix\Seo\Catalog\Service\getInstance
static getInstance()
Definition
service.php:28
Bitrix\Seo\Catalog\Service\getCatalog
getCatalog(string $type)
Definition
service.php:99
Bitrix\Seo\Catalog\Service\GROUP
const GROUP
Definition
service.php:14
Bitrix\Seo\Catalog\Service\getAuthAdapter
static getAuthAdapter($type)
Definition
service.php:85
Bitrix\Seo\Catalog\Service\TYPE_FACEBOOK
const TYPE_FACEBOOK
Definition
service.php:16
Bitrix\Seo\Retargeting\AuthAdapter
Definition
authadapter.php:13
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\Seo\Catalog
Definition
catalog.php:3
modules
seo
lib
catalog
service.php
Создано системой
1.10.0