Метод preloadUsers
Расположение
Исходный файл метода в Bitrix Framework
~/bitrix/modulesim/lib/V2/Entity/User/UserFactory.php
Исходный код
Сигнатура метода
public function preloadUsers(array $userIds): void
Возвращает:
void
Описание
Warms the user cache for a batch of ids, so that subsequent per-user lookups (User::getInstance / getUserById) read from the hot cache instead of issuing one SQL per user. Already cached ids — negative entries included — are promoted to the static level without touching the database; only true cache misses are selected and written straight to both cache levels — without a per-id getOrSet() that would re-probe the caches just checked. The levels are probed one by one because only a level-exact get() reports a NegativeHit: the All-level chain collapses it to a miss, which would re-select ids already known to be absent. The rows are selected by the same query as getUserFromDb(), prepared by the same prepareUserData() and mapped by the same UserMapper as the cache read path, with the same tags, so the cached representation is identical to the per-user read. Ids missing from the database are cached negatively, as the per-user path does.
Параметры
1| Имя | Тип | По умолчанию | Флаги |
|---|---|---|---|
$userIds
|
array
|
-
|
-
|