5use Bitrix\Main\Entity\Query;
50 $attributes = parent::getMapAttributes();
51 $attributes[
'GID'] =
'gId';
52 $attributes[
'BOARD_KEY'] =
'boardKey';
53 $attributes[
'USER_ID'] =
'userId';
54 $attributes[
'VERSION'] =
'version';
67 'type' => Common::ONE_TO_MANY,
69 'mappedBy' =>
'dashboard'
83 $with = array(
'rows',
'rows.widgets',
'rows.widgets.configurations');
84 $filter = Query::filter();
86 $filter->logic(
'and');
87 $filter->where(
'USER_ID',
$userId);
88 $order = array(
'\Bitrix\Report\VisualConstructor\Internal\DashboardRow:DASHBOARD.WEIGHT' =>
'ASC');
89 $board = static::load($filter, $with, $order);
103 $with = array(
'rows',
'rows.widgets',
'rows.widgets.configurations',
'rows.widgets.reports',
'rows.widgets.reports.configurations');
104 $filter = Query::filter();
106 $filter->logic(
'and');
107 $filter->where(
'USER_ID', 0);
108 $order = array(
'\Bitrix\Report\VisualConstructor\Internal\DashboardRow:DASHBOARD.WEIGHT' =>
'ASC');
109 $board = static::load($filter, $with, $order);
111 if (!$board && $createIfNotExist)
114 $board->setGId(Util::generateUserUniqueId());
116 $board->setUserId(0);
131 $filter = Query::filter();
133 $filter->logic(
'and');
134 $filter->where(
'USER_ID', 0);
135 return static::load($filter);
144 public static function getCurrentUserBoardWithEverythingByBoardKey(
$boardKey)
151 $with = array(
'rows',
'rows.widgets',
'rows.widgets.configurations',
'rows.widgets.reports',
'rows.widgets.reports.configurations');
152 $filter = Query::filter();
154 $filter->logic(
'and');
155 $filter->where(
'USER_ID',
$userId);
156 $order = array(
'\Bitrix\Report\VisualConstructor\Internal\DashboardRow:DASHBOARD.WEIGHT' =>
'ASC');
157 $board = static::load($filter, $with, $order);
181 $coreBoard = clone $this;
183 $copyBoard->setBoardKey($coreBoard->getBoardKey());
184 $copyBoard->setUserId($USER->getID());
185 $copyBoard->setGId($coreBoard->getGId());
186 $rows = $coreBoard->getRows();
189 foreach (
$rows as $row)
191 $copyBoard->addRows($row->getCopyForCurrentUser());
245 return static::load(array(
259 $filter = Query::filter();
261 return static::getModelList(array(
static getDefaultBoardByBoardKey($boardKey)
static loadByBoardKeyAndUserId($boardKey, $userId)
static loadByBoardKeyMultiple($boardKey)
static getMapReferenceAttributes()
static getMapAttributes()
static getBoardWithRowsAndWidgetsByBoardKeyUserId($boardKey, $userId)
static getTableClassName()
static getDefaultBoardWithEverythingByBoardKey($boardKey, $createIfNotExist=true)