Метод resolveDialogIdMap

Расположение

Исходный файл метода в Bitrix Framework

Путь к исходному файлу строки 148–180
~/bitrix/modulesim/lib/V2/Folder/FolderCollection.php

Исходный код

PHP
private

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

private function resolveDialogIdMap(): ?array

Возвращает: ?array

Описание

Resolves dialogIds for every {@see PersonalFolder} chat across the whole collection in a single {@see ChatDialogIdResolver::resolve} call, so each folder's {@see PersonalFolder::toRestFormat} reads from the shared map instead of resolving on its own (prevents N+1). System folders have no composition and are skipped. Invariant: a collection is single-user (the only caller is `listAction → getByUser`), so the context user against whom private companions are resolved is taken from the folders themselves. Batch-resolving relies on this: a single context user is used for the whole map, and a private chat's companion is only unambiguous for a user who participates in it. If a future caller ever mixes folders of different users, we bail out of batching (return null) so each folder resolves its own chat ids against its own user in {@see PersonalFolder::toRestFormat} — correct, just not batched — instead of silently returning a wrong companion.