• Модуль: webdav
  • Путь к файлу: ~/bitrix/modules/webdav/classes/usertypewebdav.php
  • Класс: CUserTypeWebdavElement
  • Вызов: CUserTypeWebdavElement::_getBlogPostCommentFiles
static function _getBlogPostCommentFiles($postID)
{
	$arCommentID = array();
	$dbComments = CBlogComment::GetList(array(), array("POST_ID" => intval($postID)), false, false, array("ID"));
	if ($dbComments)
	{
		while($arComment = $dbComments->Fetch())
		{
			$arCommentID[] = $arComment['ID'];
		}
	}

	$arFiles = array();
	foreach($arCommentID as $commentID)
	{
		$entity_type = static::$UF_TYPE_BLOG_COMMENT;
		$entity_id = static::$UF_EID_BLOG_COMMENT;
		$arUF = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFields($entity_type, $commentID);
		if (isset($arUF[$entity_id]) &&
			is_array($arUF[$entity_id]['VALUE']) &&
			(sizeof($arUF[$entity_id]['VALUE']) > 0))
		{
			$arFiles = array_merge($arFiles, $arUF[$entity_id]['VALUE']);
		}
	}

	return array_unique($arFiles);
}