* get own reports which are marked as favorites * * @return array|bool * @throws Exception */
()
| 376 | * @throws Exception |
| 377 | */ |
| 378 | public function getOwnFavoriteReports() { |
| 379 | $ownReports = $this->ReportMapper->index(); |
| 380 | $sharedReports = $this->ShareService->getSharedItems(ShareService::SHARE_ITEM_TYPE_REPORT); |
| 381 | $favorites = $this->tagManager->load('analytics')->getFavorites(); |
| 382 | |
| 383 | // remove the favorite if the report is not existing anymore |
| 384 | foreach ($favorites as $favorite) { |
| 385 | if (!in_array($favorite, array_column($ownReports, 'id')) && !in_array($favorite, array_column($sharedReports, 'id'))) { |
| 386 | unset($favorites[$favorite]); |
| 387 | $this->removeFavoriteTag('analytics', $favorite); |
| 388 | } |
| 389 | } |
| 390 | |
| 391 | return $favorites; |
| 392 | } |
| 393 | |
| 394 | /** |
| 395 | * set/remove the favorite flag for a report |
nothing calls this directly
no test coverage detected