• Модуль: report
  • Путь к файлу: ~/bitrix/modules/report/lib/visualconstructor/helper/dashboard.php
  • Класс: BitrixReportVisualConstructorHelperDashboard
  • Вызов: Dashboard::renewDefaultDashboard
static function renewDefaultDashboard($boardKey)
{
	$board = new DefaultBoardProvider();
	$board->addFilter('boardKey', $boardKey);
	$board = $board->execute()->getFirstResult();
	if ($board)
	{
		if (!$board->getVersion())
		{
			throw new SystemException("To renew default dashboard in db state, version of dashboard should exist");
		}

		$boardFromDb = DashboardEntity::getDefaultBoardByBoardKey($boardKey);

		if ($boardFromDb && $boardFromDb->getVersion() !== $board->getVersion())
		{
			$boardFromDb->delete();
			$board->save();
		}
		elseif (!$boardFromDb)
		{
			$board->save();
		}
	}
}