* get own reports which are marked as favorites * * @return array|bool * @throws Exception */
()
| 409 | * @throws Exception |
| 410 | */ |
| 411 | public function getOwnFavoriteReports() { |
| 412 | $ownReports = $this->ReportMapper->index(); |
| 413 | $sharedReports = $this->ShareService->getSharedItems(ShareService::SHARE_ITEM_TYPE_REPORT); |
| 414 | $favorites = $this->tagManager->load('analytics')->getFavorites(); |
| 415 | |
| 416 | // remove the favorite if the report is not existing anymore |
| 417 | foreach ($favorites as $favorite) { |
| 418 | if (!in_array($favorite, array_column($ownReports, 'id')) && !in_array($favorite, array_column($sharedReports, 'id'))) { |
| 419 | unset($favorites[$favorite]); |
| 420 | $this->removeFavoriteTag('analytics', $favorite); |
| 421 | } |
| 422 | } |
| 423 | |
| 424 | return $favorites; |
| 425 | } |
| 426 | |
| 427 | /** |
| 428 | * set/remove the favorite flag for a report |
nothing calls this directly
no test coverage detected