• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/UI/FileUploader/ProductController.php
  • Класс: BitrixCatalogUIFileUploaderProductController
  • Вызов: ProductController::__construct
public function __construct(array $options = [])
{
	$options['productId'] ??= 0;
	$options['productId'] = is_numeric($options['productId']) ? (int)$options['productId'] : 0;

	$options['iblockId'] ??= 0;
	$options['iblockId'] = (int)$options['iblockId'];

	if (empty($options['iblockId']) && !empty($options['productId']))
	{
		$options['iblockId'] = (int)CIBlockElement::GetIBlockByID($options['productId']);
	}

	if (empty($options['iblockId']))
	{
		throw new ArgumentException('Parameter "iblockId" must be defined in options.');
	}

	$iblockInfo = ServiceContainer::getIblockInfo($options['iblockId']);
	if (!$iblockInfo)
	{
		throw new ArgumentException("Iblock {{$options['iblockId']}} is not supported.");
	}

	$options['fieldName'] ??= MorePhotoImage::CODE;
	$options['fieldName'] = (string)$options['fieldName'];

	if ($options['fieldName'] === '')
	{
		throw new ArgumentException('Parameter "fieldName" must be defined in options.');
	}

	$this->property = $this->loadProperty($options['iblockId'], $options['fieldName']);

	parent::__construct($options);
}