• Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/update/assets/fixfontweight.php
  • Класс: BitrixLandingUpdateAssetsFixFontWeight
  • Вызов: FixFontWeight::execute
public function execute(array &$result): bool
{
	$res = HookDataTable::getList(
		[
			'select' => [
				'ID', 'VALUE'
			],
			'filter' => [
				'HOOK' => 'FONTS',
			],
		]
	);

	if (!$result['checkedRows'])
	{
		$result['checkedRows'] = 0;
	}

	$countFixedRows = 0;
	$countRows = 0;
	while ($row = $res->fetch())
	{
		if ($countRows > $result['checkedRows'])
		{
			$result['checkedRows']++;
			$search = self::FONT_PARAMS;
			$replace = self::FONT_NEW_PARAMS;
			$value = str_replace($search, $replace, $row['VALUE']);
			HookDataTable::update(
				$row['ID'],
				['VALUE' => $value]
			);
			$countFixedRows++;
			if ($countFixedRows === self::STEP_PORTION)
			{
				$result['checkedRows'] = $countRows;
				return self::CONTINUE_EXECUTING;
			}
		}
		$countRows++;
	}

	return self::STOP_EXECUTING;
}