1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
servicefactory.php
См. документацию.
1<?php
2
3namespace Bitrix\Seo\BusinessSuite\Utils;
4
5use Bitrix\Seo;
6use Bitrix\Seo\BusinessSuite\Exception;
7
8final class ServiceFactory
9{
11 private static $enginePool;
12
16 private static function getServices() : array
17 {
18 return [
25 ];
26 }
27
31 private static function getEnginePool() : array
32 {
33 if(!static::$enginePool)
34 {
35 static::$enginePool = [];
36 foreach (self::getServices() as $service)
37 {
38 foreach ($service::getTypes() as $type)
39 {
40 static::$enginePool[$service::getEngineCode($type)] = $service;
41 }
42 }
43 }
44 return static::$enginePool;
45 }
46
54 public static function getServiceByEngineCode(string $engineCode) : Seo\BusinessSuite\IInternalService
55 {
56 if(array_key_exists($engineCode,$pool = static::getEnginePool()))
57 {
58 return $pool[$engineCode];
59 }
60 throw new Exception\ServiceLoadException('EngineCode');
61 }
62}
$type
Определения options.php:106
static getInstance()
Определения service.php:31
static getInstance()
Определения service.php:75
static getServiceByEngineCode(string $engineCode)
Определения servicefactory.php:54
static getInstance()
Определения service.php:28
static getInstance()
Определения service.php:48
static getInstance()
Определения service.php:28
static getInstance()
Определения service.php:25
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$service
Определения payment.php:18