• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/classes/general/im_chat.php
  • Класс: CIMChat
  • Вызов: CIMChat::GetEntityChat
static function GetEntityChat($entityType, $entityId)
{
	$entityType = trim($entityType);
	$entityId = trim($entityId);

	if (empty($entityType) || empty($entityId))
	{
		return false;
	}

	$chatData = BitrixImModelChatTable::getList(Array(
		'select' => ['ID'],
		'filter' => [
			'=ENTITY_TYPE' => $entityType,
			'=ENTITY_ID' => $entityId,
		]
	))->fetch();

	if (!$chatData)
	{
		return false;
	}

	return $chatData['ID'];
}