1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
service.php
См. документацию.
1<?php
2
3namespace Bitrix\Seo\Catalog;
4
5use Bitrix\Seo\BusinessSuite\IInternalService;
6use Bitrix\Seo\Retargeting\AuthAdapter;
7use Bitrix\Seo\Retargeting\IService;
8
9final 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}
$type
Определения options.php:106
create()
Определения directoryentry.php:12
static getTypes()
Определения service.php:76
static getEngineCode($type)
Определения service.php:68
static getTypeByEngine(string $engineCode)
Определения service.php:37
static getMethodPrefix()
Определения service.php:60
static canUseAsInternal()
Определения service.php:52
static getInstance()
Определения service.php:28
getCatalog(string $type)
Определения service.php:99
const GROUP
Определения service.php:14
static getAuthAdapter($type)
Определения service.php:85
const TYPE_FACEBOOK
Определения service.php:16
static create($type, IService $service=null, bool $ignoreType=false)
Определения authadapter.php:43
setService(IService $service)
Определения baseapiobject.php:72
</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