get('name'); } public function getType(): string { return $this->get('type'); } /** * @return string[] */ public function getRuntimeFilters(): array { return $this->get('runtimeFilters') ?? []; } public function isInternal(): bool { return $this->get('isInternal'); } public function getTargetEntityType(): ?string { return $this->get('entityType'); } public function getPortals(): LinkMultiple { /** @var LinkMultiple */ return $this->getValueObject('portals'); } public function getTableMode(): ?string { return count($this->getGroupBy()) === 2 ? $this->get('tableMode') : null; } public function setTableMode(string $mode): self { $this->set('tableMode', $mode); return $this; } /** * @return bool */ protected function _hasJoinedReportsIds() { return $this->has('joinedReportDataList'); } /** * @return bool */ protected function _hasJoinedReportsNames() { return $this->has('joinedReportDataList'); } /** * @return bool */ protected function _hasJoinedReportsColumns() { return $this->has('joinedReportDataList'); } /** * @return string[][] */ protected function _getJoinedReportsIds() { $idList = []; $dataList = $this->get('joinedReportDataList'); if (!is_array($dataList)) { return []; } foreach ($dataList as $item) { if (empty($item->id)) { continue; } $idList[] = $item->id; } return $idList; } /** * @return object */ protected function _getJoinedReportsNames() { $nameMap = (object) []; $dataList = $this->get('joinedReportDataList'); if (!is_array($dataList)) { return $nameMap; } foreach ($dataList as $item) { if (empty($item->id)) { continue; } $report = $this->entityManager->getEntity('Report', $item->id); if (!$report) { continue; } $nameMap->{$item->id} = $report->get('name'); } return $nameMap; } /** * @return object */ protected function _getJoinedReportsColumns() { $map = (object) []; $dataList = $this->get('joinedReportDataList'); if (!is_array($dataList)) { return $map; } foreach ($dataList as $item) { if (empty($item->id)) { continue; } if (!isset($item->label)) { continue; } $map->{$item->id} = (object) [ 'label' => $item->label ]; } return $map; } public function getOrderByList(): ?string { return $this->get('orderByList'); } /** * @return string[] */ public function getColumns(): array { return $this->get('columns') ?? []; } /** * @return string[] */ public function getGroupBy(): array { return $this->get('groupBy') ?? []; } /** * @return string[] */ public function getOrderBy(): array { return $this->get('orderBy') ?? []; } public function getColumnsData(): stdClass { return $this->get('columnsData') ?? (object) []; } public function getApplyAcl(): bool { return (bool) $this->get('applyAcl'); } public function setName(string $name): self { $this->set('name', $name); return $this; } public function setApplyAcl(bool $applyAcl = true): self { $this->set('applyAcl', $applyAcl); return $this; } /** * @return string[] */ public function getJoinedReportIdList(): array { return $this->get('joinedReportsIds') ?? []; } public function getInternalParams(): stdClass { return $this->get('internalParams') ?? (object) []; } public function getInternalClassName(): ?string { return $this->get('internalClassName'); } public function setChartType(?string $chartType): self { $this->set('chartType', $chartType); return $this; } public function getChartType(): ?string { return $this->get('chartType'); } }