Your IP : 172.70.80.238


Current Path : /var/www/element/data/www/revenuestory.ru/bitrix/modules/main/lib/access/role/
Upload File :
Current File : /var/www/element/data/www/revenuestory.ru/bitrix/modules/main/lib/access/role/roledictionary.php

<?php
/**
 * Bitrix Framework
 * @package bitrix
 * @subpackage main
 * @copyright 2001-2021 Bitrix
 */

namespace Bitrix\Main\Access\Role;

use Bitrix\Main\Localization\Loc;

abstract class RoleDictionary
	implements AccessibleRoleDictionary
{
	protected static $locLoaded = [];

	public static function getRoleName(string $code): string
	{
		static::loadLoc();

		$name = Loc::getMessage($code);
		if ($name)
		{
			return $name;
		}
		return $code;
	}

	protected static function loadLoc()
	{
		if (!static::$locLoaded[static::class])
		{
			$r = new \ReflectionClass(static::class);
			Loc::loadMessages($r->getFileName());
			static::$locLoaded[static::class] = true;
		}
	}
}