%PDF- %PDF-
Server IP : 37.220.80.31 / Your IP : 3.133.148.117 Web Server : Apache/2.4.52 (Ubuntu) System : Linux 3051455-guretool.twc1.net 5.15.0-107-generic #117-Ubuntu SMP Fri Apr 26 12:26:49 UTC 2024 x86_64 User : www-root ( 1010) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/www-root/data/www/dev.artlot24.ru/bitrix/modules/sender/lib/internals/ |
Upload File : |
<?php /** * Bitrix Framework * @package bitrix * @subpackage sender * @copyright 2001-2012 Bitrix */ namespace Bitrix\Sender\Internals; use Bitrix\Main\Localization\Loc; use Bitrix\Sender\Integration; Loc::loadMessages(__FILE__); /** * Class Type * @package Bitrix\Sender\Internals */ class ClassConstant { /** * Get caption. * * @param integer $id ID. * @return integer|null */ public static function getName($id) { static $integration = null; if ($integration === null) { $integration = Integration\EventHandler::onConstantList(get_called_class()); } foreach ($integration as $item) { if ($item['id'] === $id) { return $item['name']; } } return static::getCode($id); } /** * Get class constants. * * @return array */ protected static function getConstants() { static $constants = null; if ($constants === null) { $class = new \ReflectionClass(get_called_class()); $list = $class->getConstants(); $integration = Integration\EventHandler::onConstantList(get_called_class()); foreach ($integration as $item) { $list[$item['code']] = $item['id']; } $constants = $list; } return $constants; } /** * Get list. * * @return array */ public static function getList() { $result = array(); $constants = static::getConstants(); foreach ($constants as $code => $id) { $result[] = $id; } return $result; } /** * Get codes. * * @return array */ public static function getCodes() { $result = array(); $constants = static::getConstants(); foreach ($constants as $code => $id) { $result[] = $code; } return $result; } /** * Get named list. * * @return array */ public static function getNamedList() { $result = array(); $constants = static::getConstants(); foreach ($constants as $code => $id) { $result[$id] = static::getName($id); } return $result; } /** * Get named list. * * @return array */ public static function getNamedCodes() { $result = array(); $constants = static::getConstants(); foreach ($constants as $code => $id) { $result[$code] = static::getName($id); } return $result; } /** * Get ID. * * @param string $code Code. * @return integer|null */ public static function getId($code) { $constants = static::getConstants(); return isset($constants[$code]) ? $constants[$code] : null; } /** * Get code. * * @param integer $id ID. * @return string|null */ public static function getCode($id) { $constants = static::getConstants(); foreach ($constants as $constantCode => $constantId) { if ($constantId != $id) { continue; } return $constantCode; } return null; } }