1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
service.php
См. документацию.
1<?php
2
3namespace Bitrix\Seo\BusinessSuite;
4
5
6use Bitrix\Seo\Retargeting;
7use Bitrix\Seo\BusinessSuite\AuthAdapter\Facebook\BusinessAuthAdapter;
8
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}
$type
Определения options.php:106
create($actionName)
Определения controller.php:637
create()
Определения directoryentry.php:12
static getTypes()
Определения service.php:99
static getEngineCode($type)
Определения service.php:91
getConfig(string $type)
Определения service.php:37
const INSTAGRAM_TYPE
Определения service.php:13
const FACEBOOK_TYPE
Определения service.php:12
static getTypeByEngine(string $engineCode)
Определения service.php:123
static getMethodPrefix()
Определения service.php:27
static canUseAsInternal()
Определения service.php:140
getAccount(string $type)
Определения service.php:67
static getInstance()
Определения service.php:75
static getAuthAdapter($type)
Определения service.php:110
getConversion(string $type)
Определения service.php:57
getExtension(string $type)
Определения service.php:47
static create($type, $parameters=null, IService $service=null)
Определения baseapiobject.php:61
</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