Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
roledictionary.php
1<?php
10
12
13abstract class RoleDictionary
15{
16 protected static $locLoaded = [];
17
18 public static function getRoleName(string $code): string
19 {
20 static::loadLoc();
21
22 $name = Loc::getMessage($code);
23 if ($name)
24 {
25 return $name;
26 }
27 return $code;
28 }
29
30 protected static function loadLoc()
31 {
32 if (
33 !array_key_exists(static::class, static::$locLoaded)
34 || !static::$locLoaded[static::class]
35 )
36 {
37 $r = new \ReflectionClass(static::class);
38 Loc::loadMessages($r->getFileName());
39 static::$locLoaded[static::class] = true;
40 }
41 }
42}
static loadMessages($file)
Definition loc.php:64
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29