29 $nameFormat = ($params[
'nameFormat'] ?? \CSite::getNameFormat());
33 $userIdList = array_map(
static function ($userId) {
37 $userIdList = array_filter($userIdList,
static function ($userId) {
41 $userIdList = array_unique($userIdList);
43 if (empty($userIdList))
48 if (!isset($cache[$nameFormat]))
50 $cache[$nameFormat] = [];
53 $result = array_filter($cache[$nameFormat],
function($cacheItem, $userId) use ($userIdList) {
54 return in_array($userId, $userIdList);
55 }, ARRAY_FILTER_USE_BOTH);
57 $userIdListToGet = array_diff($userIdList, array_keys($cache[$nameFormat]));
58 if (!empty($userIdListToGet))
60 $res = self::$userTableClass::getList([
62 '@ID' => $userIdListToGet,
74 $useLogin = ModuleManager::isModuleInstalled(
'intranet');
76 while ($userFields = $res->fetch())
78 $value = \CUser::FormatName($nameFormat, $userFields, $useLogin,
false);
79 $result[(int)$userFields[
'ID']] = $value;
80 $cache[$nameFormat][(int)$userFields[
'ID']] = $value;