• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/V2/Message/CounterServiceLegacy.php
  • Класс: BitrixImV2MessageCounterServiceLegacy
  • Вызов: CounterServiceLegacy::getMapChatToDialog
protected function getMapChatToDialog(array $privateChatIds)
{
	if (empty($privateChatIds))
	{
		return [];
	}

	$result = RelationTable::query()
		->setSelect(['USER_ID', 'CHAT_ID'])
		->whereNot('USER_ID', $this->getContext()->getUserId())
		->whereIn('CHAT_ID', $privateChatIds)
		->fetchAll()
	;

	$map = [];

	foreach ($result as $row)
	{
		$map[$row['CHAT_ID']] = $row['USER_ID'];
	}

	return $map;
}