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/cvetdv.ru/bitrix/modules/yandex.market/lib/data/barcode/ |
Upload File : |
<?php namespace Yandex\Market\Data\Barcode; use Bitrix\Main; use Yandex\Market; Main\Localization\Loc::loadMessages(__FILE__); class Manager { use Market\Reference\Concerns\HasLang; const FORMAT_CODE128 = 'code128'; /** * @param $template string * @return AbstractFormat * @throws Main\SystemException */ public static function createFormat($template) { $className = static::getFormatClassName($template); static::validateFormatClassName($className); return new $className; } protected static function getFormatClassName($template) { return __NAMESPACE__ . '\\' . ucfirst($template) . 'Format'; } protected static function validateFormatClassName($className) { if (!class_exists($className)) { throw new Main\SystemException(static::getLang('DATA_BARCODE_FORMAT_CLASS_NOT_FOUND')); } if (!is_subclass_of($className, AbstractFormat::class)) { throw new Main\SystemException(static::getLang('DATA_BARCODE_FORMAT_CLASS_INVALID')); } } }