Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/seo/lib/catalog/ |
Upload File : |
<?php namespace Bitrix\Seo\Catalog; use Bitrix\Seo\BusinessSuite\IInternalService; use Bitrix\Seo\Retargeting\AuthAdapter; use Bitrix\Seo\Retargeting\IService; final class Service implements IService, IInternalService { /** @var AuthAdapter[] $authAdapterPool*/ private static $authAdapterPool = []; public const GROUP = 'catalog'; public const TYPE_FACEBOOK = 'facebook'; private function __construct() {} private function __clone() {} /** * @return static */ public static function getInstance(): Service { static $instance; return $instance = $instance ?? new Service; } /** * @inheritDoc */ public static function getTypeByEngine(string $engineCode): ?string { foreach (self::getTypes() as $type) { if($engineCode === self::getEngineCode($type)) { return $type; } } return null; } /** * @inheritDoc */ public static function canUseAsInternal(): bool { return true; } /** * @inheritDoc */ public static function getMethodPrefix(): string { return self::GROUP; } /** * @inheritDoc */ public static function getEngineCode($type) : string { return self::GROUP . '.' . $type; } /** * @inheritDoc */ public static function getTypes() : array { return [ self::TYPE_FACEBOOK ]; } /** * @inheritDoc * @throws \Bitrix\Main\SystemException */ public static function getAuthAdapter($type) : AuthAdapter { if (!array_key_exists( $type, self::$authAdapterPool )) { return self::$authAdapterPool[$type] = AuthAdapter::create($type)->setService(self::getInstance()); } return self::$authAdapterPool[$type]; } /** * @param string $type * * @return Catalog */ public function getCatalog(string $type): Catalog { return Catalog::create($type)->setService($this); } }