Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
typeaccesscontroller.php
1<?php
2
4
10
12{
13 public static array $cache = [];
14
15 private const USER_TYPE = 'USER';
16
17 protected function loadItem(int $itemId = null): ?AccessibleItem
18 {
19 return null;
20 }
21
22 protected function loadUser(int $userId): AccessibleUser
23 {
24 $key = self::USER_TYPE . '_' . $userId;
25 if (!array_key_exists($key, static::$cache))
26 {
27 static::$cache[$key] = UserModel::createFromId($userId);
28 }
29
30 return static::$cache[$key];
31 }
32}