CCrmRestProxyBase::convertFileData

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmRestProxyBase
  4. convertFileData
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/restservice.php
  • Класс: \CCrmRestProxyBase
  • Вызов: CCrmRestProxyBase::convertFileData
static function convertFileData($fileData)
{
	if (!is_array($fileData))
	{
		return array();
	}

	foreach ($fileData as $key => $value)
	{
		if ($value['date'] instanceof \Bitrix\Main\Type\DateTime)
		{
			$fileData[$key]['date'] = date('c', $value['date']->getTimestamp());
		}

		foreach (['urlPreview', 'urlShow', 'urlDownload'] as $field)
		{
			$url = $fileData[$key][$field];
			if (is_string($url) && $url && mb_strpos($url, 'http') !== 0)
			{
				$fileData[$key][$field] = self::getPublicDomain().$url;
			}
		}
	}

	return $fileData;
}

Добавить комментарий