• Модуль: socialnetwork
  • Путь к файлу: ~/bitrix/modules/socialnetwork/lib/integration/ai/controller.php
  • Класс: BitrixSocialnetworkIntegrationAIController
  • Вызов: Controller::getLastComments
static function getLastComments(int $logId, int $limit = 10): array
{
	$textParser = new CTextParser();

	$comments = [];

	$queryCommentObject = CSocNetLogComments::getList(
		['ID' => 'DESC'],
		[
			'LOG_ID' => $logId,
			'!=MESSAGE' => BitrixSocialnetworkCommentAuxTaskInfo::POST_TEXT,
		],
		false,
		['nTopCount' => $limit],
		['TEXT_MESSAGE']
	);
	while ($logCommentData = $queryCommentObject->fetch())
	{
		$comments[] = $textParser->clearAllTags($logCommentData['TEXT_MESSAGE']);
	}

	return $comments;
}