• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/FileUploader/EntityController.php
  • Класс: Bitrix\Crm\FileUploader\EntityController
  • Вызов: EntityController::__construct
public function __construct(array $options)
{
	$options['entityTypeId'] ??= \CCrmOwnerType::Undefined;
	$options['entityTypeId'] = (int)$options['entityTypeId'];

	if (empty($options['entityTypeId']) || !\CCrmOwnerType::IsDefined($options['entityTypeId']))
	{
		throw new ArgumentException('Parameter "entityTypeId" must be defined in options.');
	}

	$factory = Container::getInstance()->getFactory($options['entityTypeId']);
	if (!$factory)
	{
		throw new ArgumentException("Entity type {{$options['entityTypeId']}} is not supported.");
	}

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

	$options['categoryId'] ??= null;
	if ($options['categoryId'] !== null)
	{
		$options['categoryId'] = (int)$options['categoryId'];
	}

	parent::__construct($options);

	$this->userPermissions = Container::getInstance()->getUserPermissions();
}