• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/restriction/clientfieldsrestriction.php
  • Класс: Bitrix\Crm\Restriction\ClientFieldsRestriction
  • Вызов: ClientFieldsRestriction::__construct
public function __construct(int $entityTypeId)
{
	$this->entityTypeId = $entityTypeId;

	// crm_client_fields_deal_limit
	$restrictionName = 'crm_client_fields_' . mb_strtolower(CCrmOwnerType::ResolveName($entityTypeId)) . '_limit';
	$limit = max(0, (int)Bitrix24Manager::getVariable($restrictionName));
	$maxLimit = Bitrix24Manager::getMaxVariable($restrictionName);
	$restrictionSliderInfo = [
		'ID' => $limit === $maxLimit ? static::MAX_RESTRICTION_SLIDER_CODE : static::RESTRICTION_SLIDER_CODE
	];

	parent::__construct($restrictionName, $limit, null, $restrictionSliderInfo);

	$this->load(); // load actual $limit from options
}