• Модуль: socialnetwork
  • Путь к файлу: ~/bitrix/modules/socialnetwork/lib/componenthelper.php
  • Класс: BitrixSocialnetworkComponentHelper
  • Вызов: ComponentHelper::getBlogCommentData
static function getBlogCommentData($commentId, $languageId)
{
	$result = [];

	if (isset(self::$commentsCache[$commentId]))
	{
		$result = self::$commentsCache[$commentId];
	}
	else
	{
		$selectedFields = [ "ID", "BLOG_GROUP_ID", "BLOG_GROUP_SITE_ID", "BLOG_ID", "POST_ID", "AUTHOR_ID", "AUTHOR_NAME", "AUTHOR_EMAIL", "POST_TEXT", "DATE_CREATE", "PUBLISH_STATUS", "HAS_PROPS", "SHARE_DEST" ];

		$connection = Application::getConnection();
		if ($connection instanceof BitrixMainDBMysqlCommonConnection)
		{
			$selectedFields[] = "DATE_CREATE_TS";
		}

		$res = CBlogComment::getList(
			[],
			[
				"ID" => $commentId
			],
			false,
			false,
			$selectedFields
		);

		if ($comment = $res->fetch())
		{
			$p = new blogTextParser();

			self::processCommentData($comment, $languageId, $p);

			$result = $comment;
		}

		self::$commentsCache[$commentId] = $result;
	}

	return $result;
}