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/main/lib/userfield/internal/ |
Upload File : |
<?php namespace Bitrix\Main\UserField\Internal; /** * @deprecated */ abstract class TypeFactory { protected $itemEntities = []; /** * @return TypeDataManager */ abstract public function getTypeDataClass(): string; /** * @return PrototypeItemDataManager */ abstract public function getItemPrototypeDataClass(): string; abstract public function getCode(): string; /** * @param mixed $type * @return PrototypeItemDataManager */ public function getItemDataClass($type): string { return $this->getItemEntity($type)->getDataClass(); } public function getItemEntity($type): \Bitrix\Main\ORM\Entity { $typeData = $this->getTypeDataClass()::resolveType($type); if(!empty($typeData) && isset($this->itemEntities[$typeData['ID']])) { return $this->itemEntities[$typeData['ID']]; } $entity = $this->getTypeDataClass()::compileEntity($type); $this->itemEntities[$typeData['ID']] = $entity; return $entity; } /** * @return Item */ public function getItemParentClass(): string { return Item::class; } public function getUserFieldEntityPrefix(): string { $code = $this->getCode(); return static::getPrefixByCode($code).'_'; } public function getUserFieldEntityId(int $typeId): string { return $this->getUserFieldEntityPrefix().$typeId; } public static function getCodeByPrefix(string $prefix): string { return mb_strtolower($prefix); } public static function getPrefixByCode(string $code): string { return mb_strtoupper($code); } public function prepareIdentifier($identifier) { return (int)$identifier; } }