• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/volume/storage/storage.php
  • Класс: BitrixDiskVolumeStorageStorage
  • Вызов: Storage::getUrl
static function getUrl(VolumeFragment $fragment): ?string
{
	$storage = $fragment->getStorage();
	if (!$storage instanceof DiskStorage)
	{
		throw new ArgumentTypeException('Fragment must be subclass of '.DiskStorage::className());
	}

	if (
		in_array($storage->getEntityType(), VolumeModuleIm::getEntityType()) ||
		in_array($storage->getEntityType(), VolumeModuleMail::getEntityType()) ||
		in_array($storage->getEntityType(), VolumeModuleDocumentgenerator::getEntityType())
	)
	{
		$url = $storage->getProxyType()->getStorageBaseUrl();
	}
	else
	{
		$url = $storage->getProxyType()->getBaseUrlFolderList();
	}

	$testUrl = trim($url, '/');
	if (
		$testUrl == '' ||
		$testUrl == DiskProxyTypeBase::SUFFIX_FOLDER_LIST ||
		$testUrl == DiskProxyTypeBase::SUFFIX_DISK
	)
	{
		return null;
	}

	return $url;
}