EntityEditorConfig::setCurrentScope

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. EntityEditorConfig
  4. setCurrentScope
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/entity/entityeditorconfig.php
  • Класс: Bitrix\Crm\Entity\EntityEditorConfig
  • Вызов: EntityEditorConfig::setCurrentScope
public function setCurrentScope()
{
	$configId = $this->getConfigId();
	$configScope = $this->configuration->getScope($configId);
	$userScopeId = 0;
	if (is_array($configScope))
	{
		$userScopeId = (int)$configScope['userScopeId'];
		$configScope = $configScope['scope'];
	}
	if (!Crm\Entity\EntityEditorConfigScope::isDefined($configScope))
	{
		$configScope = Crm\Entity\EntityEditorConfigScope::COMMON;
	}
	if (
		$configScope !== Crm\Entity\EntityEditorConfigScope::CUSTOM
		|| !$userScopeId
		|| !isset(Scope::getInstance()->getUserScopes($configId, 'crm')[$userScopeId])
	)
	{
		$userScopeId = null;
		if ($configScope === Crm\Entity\EntityEditorConfigScope::CUSTOM)
		{
			$configScope = Crm\Entity\EntityEditorConfigScope::COMMON;
		}
	}

	$this->setScope($configScope);
	if ($userScopeId > 0)
	{
		$this->setUserScopeId($userScopeId);
	}
}

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