• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/integration/forum/task/topic.php
  • Класс: BitrixTasksIntegrationForumTaskTopic
  • Вызов: Topic::onAfterAdd
static function onAfterAdd($entityType, $entityId, $topicId)
{
	// 'TK' is our entity type
	if ($entityType !== 'TK')
	{
		return;
	}

	if(!(CTaskAssert::isLaxIntegers($entityId) && ((int) $entityId >= 1)))
	{
		CTaskAssert::logError('[0xb6324222] Expected integer $entityId >= 1');
		return;
	}

	if ($entityType === 'TK')
	{
		// todo: probably use low-level orm here
		(new CTasks())->update($entityId, ['FORUM_TOPIC_ID' => $topicId], ['SEND_UPDATE_PULL_EVENT' => false]);
	}

	return true;
}