- Модуль: report
- Путь к файлу: ~/bitrix/modules/report/lib/visualconstructor/entity/dashboard.php
- Класс: BitrixReportVisualConstructorEntityDashboard
- Вызов: Dashboard::getDefaultBoardWithEverythingByBoardKey
static function getDefaultBoardWithEverythingByBoardKey($boardKey, $createIfNotExist = true)
{
$with = array('rows', 'rows.widgets', 'rows.widgets.configurations', 'rows.widgets.reports', 'rows.widgets.reports.configurations');
$filter = Query::filter();
$filter->where('BOARD_KEY', $boardKey);
$filter->logic('and');
$filter->where('USER_ID', 0);
$order = array('BitrixReportVisualConstructorInternalDashboardRow:DASHBOARD.WEIGHT' => 'ASC');
$board = static::load($filter, $with, $order);
if (!$board && $createIfNotExist)
{
$board = new Dashboard();
$board->setGId(Util::generateUserUniqueId());
$board->setBoardKey($boardKey);
$board->setUserId(0);
$board->save();
}
return $board;
}