CCrmRestProxyBase::externalizeProductFile

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmRestProxyBase
  4. externalizeProductFile
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/restservice.php
  • Класс: \CCrmRestProxyBase
  • Вызов: CCrmRestProxyBase::externalizeProductFile
protected function externalizeProductFile($productID, $fieldName, $valueID, $fileID, $dynamic = true)
{
	$handlerUrl = "/bitrix/components/bitrix/crm.product.file/download.php";
	$showUrl = CComponentEngine::MakePathFromTemplate(
		"{$handlerUrl}?productId=#product_id#&fieldName=#field_name#&dynamic=#dynamic#&fileId=#file_id#",
		array(
			'field_name' => $fieldName,
			'file_id' => $fileID,
			'product_id' => $productID,
			'dynamic' => $dynamic ? 'Y' : 'N'
		)
	);

	$downloadUrl = CComponentEngine::MakePathFromTemplate(
		"{$handlerUrl}?auth=#auth#&productId=#product_id#&fieldName=#field_name#&dynamic=#dynamic#&fileId=#file_id#",
		array(
			'auth' => $this->getAuthToken(),
			'field_name' => $fieldName,
			'file_id' => $fileID,
			'product_id' => $productID,
			'dynamic' => $dynamic ? 'Y' : 'N'
		)
	);

	$result = array(
		'id' => $fileID,
		'showUrl' => $showUrl,
		'downloadUrl' => $downloadUrl
	);

	if ($dynamic)
		$result = array(
			'valueId' => $valueID,
			'value' => $result
		);

	return $result;
}

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