• Модуль: socialnetwork
  • Путь к файлу: ~/bitrix/modules/socialnetwork/lib/helper/servicecomment.php
  • Класс: BitrixSocialnetworkHelperServiceComment
  • Вызов: ServiceComment::getEntityUrl
static function getEntityUrl(array $params = []): string
{
	$result = '';

	$entityType = ($params['entityType'] ?? false);
	$entityData = ($params['entityData'] ?? []);

	if (
		!$entityType
		|| empty($entityData)
		|| !is_array($entityData)
	)
	{
		return $result;
	}

	switch ($entityType)
	{
		case CommentAuxCreateEntity::ENTITY_TYPE_TASK:
			if (Loader::includeModule('tasks'))
			{
				$result = CTaskNotifications::getNotificationPath(['ID' => $entityData['CREATED_BY']], $entityData['ID'], false);
			}
			break;
		case CommentAuxCreateEntity::ENTITY_TYPE_BLOG_POST:
			$result = $entityData['URL'];
			break;
		case CommentAuxCreateEntity::ENTITY_TYPE_CALENDAR_EVENT:
			$calendarEventProvider = new LivefeedCalendarEvent();
			$calendarEventProvider->setEntityId((int)$entityData['ID']);
			$calendarEventProvider->initSourceFields();
			$result = $calendarEventProvider->getLiveFeedUrl();
			break;
		default:
	}

	return $result;
}