• Модуль: mobile
  • Путь к файлу: ~/bitrix/modules/mobile/lib/livefeed/helper.php
  • Класс: BitrixMobileLivefeedHelper
  • Вызов: Helper::getCommentInlineAttachedImagesId
static function getCommentInlineAttachedImagesId(array $params = []): array
{
	$result = [];

	$commentId = ($params['commentId'] ?? 0);
	if ($commentId <= 0)
	{
		return $result;
	}

	$inlineDiskAttachedObjectIdImageList = ($params['inlineDiskAttachedObjectIdImageList'] ?? []);
	$commentInlineDiskData = ($params['commentInlineDiskData'] ?? []);
	$entityAttachedObjectIdList = ($params['entityAttachedObjectIdList'] && is_array($params['entityAttachedObjectIdList']) ? $params['entityAttachedObjectIdList'] : null);

	if (!empty($commentInlineDiskData['OBJECT_ID']))
	{
		foreach($commentInlineDiskData['OBJECT_ID'] as $val)
		{
			$result = array_merge($result, array_keys($inlineDiskAttachedObjectIdImageList, $val));
		}
	}

	if (!empty($commentInlineDiskData['ATTACHED_OBJECT_ID']))
	{
		$result = array_merge($result, array_intersect($commentInlineDiskData['ATTACHED_OBJECT_ID'], array_keys($inlineDiskAttachedObjectIdImageList)));
	}

	if (is_array($entityAttachedObjectIdList))
	{
		$result = array_intersect($result, $entityAttachedObjectIdList);
	}

	return $result;
}