Метод cached

public

Сигнатура метода

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

Путь к исходному файлу Source
~/bitrix/modulescrm/lib/V2/Public/Provider/Item/AbstractItemProvider.php
Расположение метода в файле
Строки 98–104

Исходный код

PHP