Метод cached
Сигнатура метода
public function cached(CacheMode $mode = CacheMode::Runtime): static
Возвращает:
static
Описание
Returns a configured copy that serves reads through the shared {@see ItemCache} ({@see CacheMode::Runtime}: in-memory, current request only). `getById()` / `getByIds()` return cached items when every requested scalar field is already loaded, and fetch only the missing fields / missing ids otherwise (one query per read, merged into the cached snapshot). `getList()` only fills the cache — a filter cannot be resolved against it. `getCount()` bypasses the cache entirely. The cache stores raw, pre-access-check data: {@see withAccessCheck()} is applied on top of the cache at return time, so the same entry can be served in full to one user and as a restricted stub to another. Entries are invalidated point-wise on writes (V2 command handlers and legacy Operations).
Параметры
1| Имя | Тип | По умолчанию | Флаги |
|---|---|---|---|
$mode
|
CacheMode
|
CacheMode::Runtime
|
—
|
Расположение
Исходный файл метода в Bitrix Framework
~/bitrix/modulescrm/lib/V2/Public/Provider/Item/AbstractItemProvider.php