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