• Модуль: socialnetwork
  • Путь к файлу: ~/bitrix/modules/socialnetwork/lib/livefeed/forumtopic.php
  • Класс: BitrixSocialnetworkLivefeedForumTopic
  • Вызов: ForumTopic::setEntityId
public function setEntityId($topicId): void // patch TOPIC->POST
{
	$topicId = (int)$topicId;
	$messageId = 0;

	if (
		$topicId > 0
		&& Loader::includeModule('forum')
	)
	{
		$res = MessageTable::getList(array(
			'order' => array('ID' => 'ASC'),
			'filter' => array(
				'TOPIC_ID' => $topicId,
			),
			'select' => array('ID')
		));
		if ($message = $res->fetch())
		{
			$messageId = $message['ID'];
		}
	}

	$this->entityId = $messageId;
}