• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/lib/V2/Chat/ChatFactory.php
  • Класс: BitrixImV2ChatChatFactory
  • Вызов: ChatFactory::getChatById
public function getChatById(int $chatId): Chat
{
	$findResult = $this->findChat(['CHAT_ID' => $chatId]);
	if ($findResult->hasResult())
	{
		$chatParams = $findResult->getResult();

		/** @var Chat $chat */
		$chat = $this->initChat($chatParams);
	}
	else
	{
		$chat = new NullChat();
	}

	return $chat;
}