• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/entity/entityeditorconfig.php
  • Класс: Bitrix\Crm\Entity\EntityEditorConfig
  • Вызов: EntityEditorConfig::reset
public function reset()
{
	if(!Crm\Entity\EntityEditorConfigScope::isDefined($this->scope) ||
		($this->scope === Crm\Entity\EntityEditorConfigScope::PERSONAL && $this->userID <= 0)
	)
	{
		throw new Main\InvalidOperationException("This operation is not permitted at current settings.");
	}

	$optionName = $this->resolveOptionName();
	if($optionName === '')
	{
		$entityTypeName = \CCrmOwnerType::ResolveName($this->entityTypeID);
		throw new Main\NotSupportedException("The entity type '{$entityTypeName}' is not supported in current context.");
	}

	if($this->scope === Crm\Entity\EntityEditorConfigScope::COMMON)
	{
		$optionName = "{$optionName}_common";
	}

	return \CUserOptions::DeleteOption(
		self::CATEGORY_NAME,
		$optionName,
		$this->scope === Crm\Entity\EntityEditorConfigScope::COMMON,
		$this->scope === Crm\Entity\EntityEditorConfigScope::PERSONAL ? $this->userID : false
	);
}