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

	$limit = 0;
	$sliderId = static::FEATURE_SLIDER_CODE;

	if (Bitrix24Manager::isFeatureEnabled(static::FEATURE_NAME))
	{
		$this->isFeatureEnabled = true;

		$limit = max(0, (int)Bitrix24Manager::getVariable(static::LIMIT_VAR_NAME));
		$sliderId = static::LIMIT_SLIDER_CODE;
	}

	parent::__construct(static::FEATURE_NAME, $limit, null, ['ID'=> $sliderId]);

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