• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/product/systemfield/productmapping/setdefaultvaluestepper.php
  • Класс: BitrixCatalogProductSystemFieldProductMappingSetDefaultValueStepper
  • Вызов: SetDefaultValueStepper::clearAbandonedSteppersAgent
static function clearAbandonedSteppersAgent(): string
{
	$option = BitrixMainConfigOption::get(
		'main.stepper.catalog',
		__CLASS__,
		null,
		''
	);
	$needRemove = false;
	if ($option !== null)
	{
		if ($option === '')
		{
			$needRemove = true;
		}
		if (!CheckSerializedData($option))
		{
			$needRemove = true;
		}
		else
		{
			$option = unserialize($option, ['allowed_classes' => false]);
			if (empty($option) || !is_array($option))
			{
				$needRemove = true;
			}
			else
			{
				if (empty($option['count']))
				{
					$needRemove = true;
				}
			}
		}
	}

	if ($needRemove)
	{
		BitrixMainConfigOption::delete(
			'main.stepper.catalog',
			[
				'name' => __CLASS__
			]
		);
	}

	return '';
}